Changeset 12561
- Timestamp:
- 02/20/08 11:34:04 (11 months ago)
- Files:
-
- 1 modified
-
dojo/trunk/date/stamp.js (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
dojo/trunk/date/stamp.js
r12050 r12561 25 25 // input may return null. Arguments which are out of bounds will be handled 26 26 // by the Date constructor (e.g. January 32nd typically gets resolved to February 1st) 27 // Only years between 100 and 9999 are supported. 27 28 // 28 29 // formattedString: … … 59 60 } 60 61 result = new Date(match[0]||1970, match[1]||0, match[2]||1, match[3]||0, match[4]||0, match[5]||0, match[6]||0); 62 // result.setFullYear(match[0]||1970); // for year < 100 61 63 62 64 var offset = 0; … … 84 86 // When options.selector is omitted, output follows RFC3339 (http://www.ietf.org/rfc/rfc3339.txt) 85 87 // The local time zone is included as an offset from GMT, except when selector=='time' (time without a date) 86 // Does not check bounds. 88 // Does not check bounds. Only years between 100 and 9999 are supported. 87 89 // 88 90 // dateObject: … … 95 97 // milliseconds- if true, output milliseconds 96 98 97 var _ = function(n){ return (n < 10) ? "0" + n : n; } 99 var _ = function(n){ return (n < 10) ? "0" + n : n; }; 98 100 options = options || {}; 99 101 var formattedDate = []; … … 101 103 var date = ""; 102 104 if(options.selector != "time"){ 103 date = [dateObject[getter+"FullYear"](), _(dateObject[getter+"Month"]()+1), _(dateObject[getter+"Date"]())].join('-'); 105 var year = dateObject[getter+"FullYear"](); 106 date = ["0000".substr((year+"").length)+year, _(dateObject[getter+"Month"]()+1), _(dateObject[getter+"Date"]())].join('-'); 104 107 } 105 108 formattedDate.push(date);