| 1 | <!DOCTYPE html> |
| 2 | <html lang="en"> |
| 3 | <head> |
| 4 | <meta http-equiv="Content-type" content="text/html; charset=utf-8"> |
| 5 | <title>Calendar Widget Test</title> |
| 6 | |
| 7 | <script type="text/javascript" src="boilerplate.js"></script> |
| 8 | |
| 9 | <style> |
| 10 | #calendar5 .dijitCalendarDateTemplate { height: 50px; width: 50px; border: 1px solid #ccc; vertical-align: top } |
| 11 | #calendar5 .dijitCalendarDateLabel, #calendar5 .dijitCalendarDateTemplate { text-align: inherit } |
| 12 | #calendar5 .dijitCalendarDayLabel { font-weight: bold } |
| 13 | #calendar5 .dijitCalendarSelectedYear { font-size: 1.5em } |
| 14 | #calendar5 .dijitCalendarMonthLabel { font-family: serif; letter-spacing: 0.2em; font-size: 2em } |
| 15 | .blue { color: blue !important /* override claro rule */ } |
| 16 | </style> |
| 17 | |
| 18 | <script type="text/javascript"> |
| 19 | require([ |
| 20 | "dojo/_base/declare", |
| 21 | "dojo/date/locale", |
| 22 | "dojo/parser", |
| 23 | "dijit/Calendar", |
| 24 | "dojo/domReady!" |
| 25 | ], function(declare, locale, parser, Calendar){ |
| 26 | declare("BigCalendar", Calendar, { |
| 27 | isDisabledDate: locale.isWeekend, |
| 28 | getClassForDate: function(date){ |
| 29 | if(!(date.getDate() % 10)){ return "blue"; } // apply special style to all days divisible by 10 |
| 30 | } |
| 31 | }); |
| 32 | |
| 33 | parser.parse(); |
| 34 | |
| 35 | disableWeekends = function(){ |
| 36 | calendar1.isDisabledDate = locale.isWeekend; |
| 37 | calendar1._populateGrid(); |
| 38 | }; |
| 39 | }); |
| 40 | |
| 41 | function myHandler(id,newValue){ |
| 42 | console.debug("onChange for id = " + id + ", value: " + newValue); |
| 43 | } |
| 44 | </script> |
| 45 | </head> |
| 46 | <body class="claro" role="main"> |
| 47 | |
| 48 | <h1 class="testTitle">Dijit Calendar Test</h1> |
| 49 | |
| 50 | <label for="before">input before: </label><input id="before"/> |
| 51 | <input id="calendar1" data-dojo-id="calendar1" data-dojo-type="dijit/Calendar" summary="Small calendar" data-dojo-props='onChange:function(v){ myHandler(this.id, v) }'/> |
| 52 | <label for="after">input after: </label><input id="after"/> |
| 53 | <p> |
| 54 | <a href="#" onclick="disableWeekends();">disable weekends</a> |
| 55 | </p> |
| 56 | |
| 57 | <p>Big Calendar</p> |
| 58 | <input id="calendar5" data-dojo-type="BigCalendar" data-dojo-props='dayWidth:"abbr"' value="2008-03-14"/> |
| 59 | </body> |
| 60 | </html> |