calendar-example.html revision 520d8bcc196e6dab14119ccec8a6e1b28b330df8
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington <script type="text/javascript" src="/build/yui/yui.js"></script>
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington.yui3-skin-sam .redtext {
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington color:#ff0000;
9ded47095ee7e6958743e0e536c470642608e288Kohei Tamura}).use('calendar', function(Y) {
9ded47095ee7e6958743e0e536c470642608e288Kohei TamuraY.CalendarBase.CONTENT_TEMPLATE = Y.CalendarBase.TWO_PANE_TEMPLATE;
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunningtonfunction myHeaderRenderer (curDate) {
2a078b3a4ba77260d6dc865a094b344102d74f10Phill Cunnington output = ydate.format(curDate, {format: "%B %Y"}) +
5db031755ab3a8762e266f96f5d74832548d330bPhill Cunnington " — " +
5db031755ab3a8762e266f96f5d74832548d330bPhill Cunnington ydate.format(ydate.addMonths(curDate, 1), {format: "%B %Y"});
5db031755ab3a8762e266f96f5d74832548d330bPhill Cunnington return output;
af38905e8a5231702db169603d942d5d2e0c4332David Luna var myRules = {"all":
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington "0,6": "all_weekends"
5db031755ab3a8762e266f96f5d74832548d330bPhill Cunnington "5": "thefifths"
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunningtonfunction myFilter (oDate, oNode, rules) {
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunningtonif (rules.indexOf("all_weekends") >= 0) {
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington var calendar = new Y.Calendar({
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington contentBox: "#mycalendar",
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington showNextMonth: true,
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington showPrevMonth: true,
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington disabledDatesRule: "thefifths",
af38905e8a5231702db169603d942d5d2e0c4332David Luna selectionMode: "multiple",
4ccae7e16b9ab014016a21612e4b9a62739f73d6tom.rumsey@forgerock.com minimumDate: new Date(2011,6,1),
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington maximumDate: new Date(2011,11,1),
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington headerRenderer: myHeaderRenderer,
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington width:'600px'}).render();
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington calendar.set("customRenderer", {rules: myRules, filterFunction: myFilter});