Changeset 12943

Show
Ignore:
Timestamp:
03/06/08 18:47:58 (10 months ago)
Author:
peller
Message:

Add TimePicker? props to TimeTextBox? constraints docs. Refs #6075 !strict

Location:
dijit/trunk
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • dijit/trunk/form/TimeTextBox.js

    r12918 r12943  
    33dojo.require("dijit._TimePicker"); 
    44dojo.require("dijit.form._DateTimeTextBox"); 
     5 
     6/*===== 
     7dojo.declare( 
     8        "dijit.form.TimeTextBox.__Constraints", 
     9        [dijit.form._DateTimeTextBox.__Constraints, dojo.date.locale.__FormatOptions] 
     10); 
     11=====*/ 
    512 
    613dojo.declare( 
     
    1320                popupClass: "dijit._TimePicker", 
    1421                _selector: "time" 
     22 
     23/*===== 
     24                // constraints: dijit._TimePicker.__Constraints  
     25                constraints:{}, 
     26=====*/ 
    1527        } 
    1628); 
  • dijit/trunk/form/_DateTimeTextBox.js

    r12920 r12943  
    99dojo.declare( 
    1010        "dijit.form._DateTimeTextBox.__Constraints", 
    11         [dijit.form.RangeBoundTextBox.__Constraints, dojo.date.locale.__FormatOptions], 
    12         {} 
     11        [dijit.form.RangeBoundTextBox.__Constraints, dojo.date.locale.__FormatOptions] 
    1312); 
    1413=====*/ 
  • dijit/trunk/_TimePicker.js

    r12505 r12943  
    33dojo.require("dijit.form._FormWidget"); 
    44dojo.require("dojo.date.locale"); 
     5 
     6/*===== 
     7dojo.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=====*/ 
    525 
    626dojo.declare("dijit._TimePicker", 
    727        [dijit._Widget, dijit._Templated], 
    828        { 
    9                 // summary: 
    10                 // A graphical time picker that TimeTextBox pops up 
    11                 // It is functionally modeled after the Java applet at http://java.arcadevillage.com/applets/timepica.htm 
    12                 // See ticket #599 
     29                //      summary: 
     30                //              A graphical time picker. 
     31                //              This widget is used internally by other widgets and is not accessible 
     32                //              as a standalone widget. 
    1333 
    1434                templatePath: dojo.moduleUrl("dijit.form", "templates/TimePicker.html"), 
     
    1737                // clickableIncrement: String 
    1838                //              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 zone 
    21                 //              Example: "T00:15:00" creates 15 minute increments 
    22                 //              Must divide visibleIncrement evenly 
     39                //              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 
    2343                clickableIncrement: "T00:15:00", 
    2444 
    2545                // visibleIncrement: String 
    2646                //              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 zone 
    29                 //              Example: "T01:00:00" creates text in every 1 hour increment 
     47                //              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 
    3050                visibleIncrement: "T01:00:00", 
    3151 
    3252                // 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 options 
     53                //              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 
    3656                visibleRange: "T05:00:00", 
    3757 
     
    3959                //              Date to display. 
    4060                //              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`), 
    4363                //              the time will be converted to the local time in the local time zone. 
    4464                //              Otherwise, the time is considered to be in the local time zone. 
    4565                //              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 time 
    51                 //              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` 
    5272                value: new Date(), 
    5373 
     
    5575                _clickableIncrement:1, 
    5676                _totalIncrements:10, 
     77 
     78                // constraints: dijit._TimePicker.__Constraints  
    5779                constraints:{}, 
    5880 
    5981                serialize: dojo.date.stamp.toISOString, 
    6082 
     83//TODOC: what is priority? 
    6184                setValue:function(/*Date*/ date, /*Boolean*/ priority){ 
    6285                        // summary: 
     
    7194                isDisabledDate: function(/*Date*/dateObject, /*String?*/locale){ 
    7295                        // summary: 
    73                         //      May be overridden to disable certain dates in the TimePicker e.g. isDisabledDate=dojo.date.locale.isWeekend 
     96                        //      May be overridden to disable certain dates in the TimePicker e.g. `isDisabledDate=dojo.date.locale.isWeekend` 
    7497                        return false; // Boolean 
    7598                }, 
    7699 
    77100                _showText:function(){ 
    78                         this.timeMenu.innerHTML=""; 
     101                        this.timeMenu.innerHTML = ""; 
    79102                        var fromIso = dojo.date.stamp.fromISOString; 
    80103                        this._clickableIncrementDate=fromIso(this.clickableIncrement); 
     
    96119 
    97120                        // assume clickable increment is the smallest unit 
    98                         this._clickableIncrement=1; 
     121                        this._clickableIncrement = 1; 
    99122                        // divide the visible range by the clickable increment to get the number of divs to create 
    100123                        // example: 10:00:00/00:15:00 -> display 40 divs 
    101                         this._totalIncrements=visibleRangeSeconds/clickableIncrementSeconds; 
     124                        this._totalIncrements = visibleRangeSeconds / clickableIncrementSeconds; 
    102125                        // divide the visible increments by the clickable increments to get how often to display the time inline 
    103126                        // 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){ 
    106129                                this.timeMenu.appendChild(this._createOption(i)); 
    107130                        }