123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160 |
- if(!dojo._hasResource["dojox.widget.CalendarViews"]){
- dojo._hasResource["dojox.widget.CalendarViews"] = true;
- dojo.provide("dojox.widget.CalendarViews");
- dojo.experimental("dojox.widget.CalendarViews");
- dojo.require("dojox.widget.Calendar");
- dojo.declare("dojox.widget._CalendarMonth", null, {
-
-
- constructor: function(){
-
- this._addView(dojox.widget._CalendarMonthView);
- }
- });
- dojo.declare("dojox.widget._CalendarMonthView", [dojox.widget._CalendarView, dijit._Templated], {
-
-
-
- templateString: dojo.cache("dojox.widget", "Calendar/CalendarMonth.html", "<div class=\"dojoxCalendarMonthLabels\" style=\"left: 0px;\" \n\tdojoAttachPoint=\"monthContainer\" dojoAttachEvent=\"onclick: onClick\">\n <table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" style=\"margin: auto;\">\n <tbody>\n <tr class=\"dojoxCalendarMonthGroupTemplate\">\n <td class=\"dojoxCalendarMonthTemplate\">\n <div class=\"dojoxCalendarMonthLabel\"></div>\n </td>\n </tr>\n </tbody>\n </table>\n</div>\n"),
-
-
-
- datePart: "year",
-
-
- headerClass: "dojoxCalendarMonthHeader",
- postCreate: function(){
-
- this.cloneClass(".dojoxCalendarMonthTemplate", 3);
- this.cloneClass(".dojoxCalendarMonthGroupTemplate", 2);
- this._populateMonths();
-
- this.addFx(".dojoxCalendarMonthLabel", this.domNode);
- },
- _setValueAttr: function(value){
- this.header.innerHTML = value.getFullYear();
- },
- _getMonthNames: dojox.widget._CalendarMonthYearView.prototype._getMonthNames,
- _populateMonths: dojox.widget._CalendarMonthYearView.prototype._populateMonths,
- onClick: function(evt){
-
- if(!dojo.hasClass(evt.target, "dojoxCalendarMonthLabel")){dojo.stopEvent(evt); return;}
- var parentNode = evt.target.parentNode;
- var month = parentNode.cellIndex + (parentNode.parentNode.rowIndex * 4);
- var date = this.get("value");
-
-
- date.setMonth(month);
- date.setMonth(month);
- this.onValueSelected(date, month);
- }
- });
- dojo.declare("dojox.widget._CalendarYear", null, {
-
-
- parent: null,
- constructor: function(){
-
-
- this._addView(dojox.widget._CalendarYearView);
- }
- });
- dojo.declare("dojox.widget._CalendarYearView", [dojox.widget._CalendarView, dijit._Templated], {
-
-
-
- templateString: dojo.cache("dojox.widget", "Calendar/CalendarYear.html", "<div class=\"dojoxCalendarYearLabels\" style=\"left: 0px;\" dojoAttachPoint=\"yearContainer\">\n <table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" style=\"margin: auto;\" dojoAttachEvent=\"onclick: onClick\">\n <tbody>\n <tr class=\"dojoxCalendarYearGroupTemplate\">\n <td class=\"dojoxCalendarNextMonth dojoxCalendarYearTemplate\">\n <div class=\"dojoxCalendarYearLabel\">\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n</div>\n"),
- displayedYears: 6,
- postCreate: function(){
-
- this.cloneClass(".dojoxCalendarYearTemplate", 3);
- this.cloneClass(".dojoxCalendarYearGroupTemplate", 2);
- this._populateYears();
- this.addFx(".dojoxCalendarYearLabel", this.domNode);
- },
- _setValueAttr: function(value){
- this._populateYears(value.getFullYear());
- },
- _populateYears: dojox.widget._CalendarMonthYearView.prototype._populateYears,
- adjustDate: function(date, amount){
-
- return dojo.date.add(date, "year", amount * 12);
- },
- onClick: function(evt){
-
- if(!dojo.hasClass(evt.target, "dojoxCalendarYearLabel")){dojo.stopEvent(evt); return;}
- var year = Number(evt.target.innerHTML);
- var date = this.get("value");
- date.setYear(year);
- this.onValueSelected(date, year);
- }
- });
- dojo.declare("dojox.widget.Calendar3Pane",
- [dojox.widget._CalendarBase,
- dojox.widget._CalendarDay,
- dojox.widget._CalendarMonth,
- dojox.widget._CalendarYear], {
-
-
- }
- );
- dojo.declare("dojox.widget.MonthlyCalendar",
- [dojox.widget._CalendarBase,
- dojox.widget._CalendarMonth], {
-
- _makeDate: function(value){
- var now = new Date();
- now.setMonth(value);
- return now;
- }
- }
- );
- dojo.declare("dojox.widget.YearlyCalendar",
- [dojox.widget._CalendarBase,
- dojox.widget._CalendarYear], {
-
- _makeDate: function(value){
- var now = new Date();
- now.setFullYear(value);
- return now;
- }
- }
- );
- }
|