Changeset 12943
- Timestamp:
- 03/06/08 18:47:58 (10 months ago)
- Location:
- dijit/trunk
- Files:
-
- 3 modified
-
form/TimeTextBox.js (modified) (2 diffs)
-
form/_DateTimeTextBox.js (modified) (1 diff)
-
_TimePicker.js (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
dijit/trunk/form/TimeTextBox.js
r12918 r12943 3 3 dojo.require("dijit._TimePicker"); 4 4 dojo.require("dijit.form._DateTimeTextBox"); 5 6 /*===== 7 dojo.declare( 8 "dijit.form.TimeTextBox.__Constraints", 9 [dijit.form._DateTimeTextBox.__Constraints, dojo.date.locale.__FormatOptions] 10 ); 11 =====*/ 5 12 6 13 dojo.declare( … … 13 20 popupClass: "dijit._TimePicker", 14 21 _selector: "time" 22 23 /*===== 24 // constraints: dijit._TimePicker.__Constraints 25 constraints:{}, 26 =====*/ 15 27 } 16 28 ); -
dijit/trunk/form/_DateTimeTextBox.js
r12920 r12943 9 9 dojo.declare( 10 10 "dijit.form._DateTimeTextBox.__Constraints", 11 [dijit.form.RangeBoundTextBox.__Constraints, dojo.date.locale.__FormatOptions], 12 {} 11 [dijit.form.RangeBoundTextBox.__Constraints, dojo.date.locale.__FormatOptions] 13 12 ); 14 13 =====*/ -
dijit/trunk/_TimePicker.js
r12505 r12943 3 3 dojo.require("dijit.form._FormWidget"); 4 4 dojo.require("dojo.date.locale"); 5 6 /*===== 7 dojo.declare( 8 "dijit._TimePicker.__Constraints", 9 [dojo.date.locale.__FormatOptions], 10 { 11 // clickableIncrement: String 12 // see dijit._TimePicker.clickableIncrement 13 clickableIncrement: "T00:15:00", 14 15 // visibleIncrement: String 16 // see dijit._TimePicker.visibleIncrement 17 visibleIncrement: "T01:00:00", 18 19 // visibleRange: String 20 // see dijit._TimePicker.visibleRange 21 visibleRange: "T05:00:00" 22 } 23 ); 24 =====*/ 5 25 6 26 dojo.declare("dijit._TimePicker", 7 27 [dijit._Widget, dijit._Templated], 8 28 { 9 // summary:10 // A graphical time picker that TimeTextBox pops up11 // It is functionally modeled after the Java applet at http://java.arcadevillage.com/applets/timepica.htm12 // See ticket #59929 // summary: 30 // A graphical time picker. 31 // This widget is used internally by other widgets and is not accessible 32 // as a standalone widget. 13 33 14 34 templatePath: dojo.moduleUrl("dijit.form", "templates/TimePicker.html"), … … 17 37 // clickableIncrement: String 18 38 // ISO-8601 string representing the amount by which 19 // every clickable element in the time picker increases 20 // Set in non-Zulu time, without a time zone21 // Example: "T00:15:00"creates 15 minute increments22 // Must divide visibleIncrement evenly39 // every clickable element in the time picker increases. 40 // Set in local time, without a time zone. 41 // Example: `T00:15:00` creates 15 minute increments 42 // Must divide dijit._TimePicker.visibleIncrement evenly 23 43 clickableIncrement: "T00:15:00", 24 44 25 45 // visibleIncrement: String 26 46 // ISO-8601 string representing the amount by which 27 // every element with a visible time in the time picker increases 28 // Set in non Zulu time, without a time zone29 // Example: "T01:00:00"creates text in every 1 hour increment47 // every element with a visible time in the time picker increases. 48 // Set in local time, without a time zone. 49 // Example: `T01:00:00` creates text in every 1 hour increment 30 50 visibleIncrement: "T01:00:00", 31 51 32 52 // visibleRange: String 33 // ISO-8601 string representing the range of this TimePicker 34 // The TimePicker will only display times in this range 35 // Example: "T05:00:00"displays 5 hours of options53 // ISO-8601 string representing the range of this TimePicker. 54 // The TimePicker will only display times in this range. 55 // Example: `T05:00:00` displays 5 hours of options 36 56 visibleRange: "T05:00:00", 37 57 … … 39 59 // Date to display. 40 60 // Defaults to current time and date. 41 // Can be a Date object or an ISO-8601 string 42 // If you specify the GMT time zone ( "-01:00"),61 // Can be a Date object or an ISO-8601 string. 62 // If you specify the GMT time zone (`-01:00`), 43 63 // the time will be converted to the local time in the local time zone. 44 64 // Otherwise, the time is considered to be in the local time zone. 45 65 // If you specify the date and isDate is true, the date is used. 46 // Example: if your local time zone is GMT -05:00,47 // "T10:00:00" becomes "T10:00:00-05:00"(considered to be local time),48 // "T10:00:00-01:00" becomes "T06:00:00-05:00"(4 hour difference),49 // "T10:00:00Z" becomes "T05:00:00-05:00"(5 hour difference between Zulu and local time)50 // "yyyy-mm-ddThh:mm:ss"is the format to set the date and time51 // Example: "2007-06-01T09:00:00"66 // Example: if your local time zone is `GMT -05:00`, 67 // `T10:00:00` becomes `T10:00:00-05:00` (considered to be local time), 68 // `T10:00:00-01:00` becomes `T06:00:00-05:00` (4 hour difference), 69 // `T10:00:00Z` becomes `T05:00:00-05:00` (5 hour difference between Zulu and local time) 70 // `yyyy-mm-ddThh:mm:ss` is the format to set the date and time 71 // Example: `2007-06-01T09:00:00` 52 72 value: new Date(), 53 73 … … 55 75 _clickableIncrement:1, 56 76 _totalIncrements:10, 77 78 // constraints: dijit._TimePicker.__Constraints 57 79 constraints:{}, 58 80 59 81 serialize: dojo.date.stamp.toISOString, 60 82 83 //TODOC: what is priority? 61 84 setValue:function(/*Date*/ date, /*Boolean*/ priority){ 62 85 // summary: … … 71 94 isDisabledDate: function(/*Date*/dateObject, /*String?*/locale){ 72 95 // summary: 73 // May be overridden to disable certain dates in the TimePicker e.g. isDisabledDate=dojo.date.locale.isWeekend96 // May be overridden to disable certain dates in the TimePicker e.g. `isDisabledDate=dojo.date.locale.isWeekend` 74 97 return false; // Boolean 75 98 }, 76 99 77 100 _showText:function(){ 78 this.timeMenu.innerHTML ="";101 this.timeMenu.innerHTML = ""; 79 102 var fromIso = dojo.date.stamp.fromISOString; 80 103 this._clickableIncrementDate=fromIso(this.clickableIncrement); … … 96 119 97 120 // assume clickable increment is the smallest unit 98 this._clickableIncrement =1;121 this._clickableIncrement = 1; 99 122 // divide the visible range by the clickable increment to get the number of divs to create 100 123 // example: 10:00:00/00:15:00 -> display 40 divs 101 this._totalIncrements =visibleRangeSeconds/clickableIncrementSeconds;124 this._totalIncrements = visibleRangeSeconds / clickableIncrementSeconds; 102 125 // divide the visible increments by the clickable increments to get how often to display the time inline 103 126 // example: 01:00:00/00:15:00 -> display the time every 4 divs 104 this._visibleIncrement =visibleIncrementSeconds/clickableIncrementSeconds;105 for(var i =-(this._totalIncrements >> 1); i<(this._totalIncrements >> 1); i+=this._clickableIncrement){127 this._visibleIncrement = visibleIncrementSeconds / clickableIncrementSeconds; 128 for(var i = -(this._totalIncrements >> 1); i < (this._totalIncrements >> 1); i += this._clickableIncrement){ 106 129 this.timeMenu.appendChild(this._createOption(i)); 107 130 }