Changeset 11385
- Timestamp:
- 11/04/07 15:27:44 (10 months ago)
- Files:
-
- 1 modified
-
dojo/trunk/date.js (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
dojo/trunk/date.js
r10771 r11385 2 2 3 3 dojo.date.getDaysInMonth = function(/*Date*/dateObject){ 4 // summary: Returns the number of days in the month used by dateObject 4 // summary: 5 // Returns the number of days in the month used by dateObject 5 6 var month = dateObject.getMonth(); 6 7 var days = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; … … 10 11 11 12 dojo.date.isLeapYear = function(/*Date*/dateObject){ 12 // summary:13 // Determines if the year of the dateObject is a leap year14 // 15 // description:16 // Leap years are years with an additional day YYYY-02-29, where the year17 // number is a multiple of four with the following exception: If a year18 // is a multiple of 100, then it is only a leap year if it is also a19 // multiple of 400. For example, 1900 was not a leap year, but2000 is one.13 // summary: 14 // Determines if the year of the dateObject is a leap year 15 // description: 16 // Leap years are years with an additional day YYYY-02-29, where the 17 // year number is a multiple of four with the following exception: If 18 // a year is a multiple of 100, then it is only a leap year if it is 19 // also a multiple of 400. For example, 1900 was not a leap year, but 20 // 2000 is one. 20 21 21 22 var year = dateObject.getFullYear(); … … 25 26 // FIXME: This is not localized 26 27 dojo.date.getTimezoneName = function(/*Date*/dateObject){ 27 // summary: 28 // Get the user's time zone as provided by the browser 29 // 30 // dateObject: needed because the timezone may vary with time (daylight savings) 31 // 32 // description: 33 // Try to get time zone info from toString or toLocaleString 34 // method of the Date object -- UTC offset is not a time zone. 35 // See http://www.twinsun.com/tz/tz-link.htm 36 // Note: results may be inconsistent across browsers. 28 // summary: 29 // Get the user's time zone as provided by the browser 30 // dateObject: 31 // Needed because the timezone may vary with time (daylight savings) 32 // description: 33 // Try to get time zone info from toString or toLocaleString method of 34 // the Date object -- UTC offset is not a time zone. See 35 // http://www.twinsun.com/tz/tz-link.htm Note: results may be 36 // inconsistent across browsers. 37 37 38 38 var str = dateObject.toString(); // Start looking in toString … … 72 72 73 73 dojo.date.compare = function(/*Date*/date1, /*Date?*/date2, /*String?*/portion){ 74 // summary:74 // summary: 75 75 // Compare two date objects by date, time, or both. 76 // 77 // description: 76 // description: 78 77 // Returns 0 if equal, positive if a > b, else negative. 79 // 80 // date1 78 // date1: 81 79 // Date object 82 // 83 // date2 80 // date2: 84 81 // Date object. If not specified, the current Date is used. 85 // 86 // portion87 // A string indicating the "date" or "time" portion of a Date object. Compares both "date" and "time" by default.88 // One of the following:"date", "time", "datetime"82 // portion: 83 // A string indicating the "date" or "time" portion of a Date object. 84 // Compares both "date" and "time" by default. One of the following: 85 // "date", "time", "datetime" 89 86 90 87 // Extra step required in copy for IE - see #3112 … … 110 107 111 108 dojo.date.add = function(/*Date*/date, /*String*/interval, /*int*/amount){ 112 // summary:109 // summary: 113 110 // Add to a Date in intervals of different size, from milliseconds to years 114 // date: Date111 // date: Date 115 112 // Date object to start with 116 // 117 // interval: 113 // interval: 118 114 // A string representing the interval. One of the following: 119 // "year", "month", "day", "hour", "minute", "second", "millisecond", "quarter", "week", "weekday"120 // 121 // amount:115 // "year", "month", "day", "hour", "minute", "second", 116 // "millisecond", "quarter", "week", "weekday" 117 // amount: 122 118 // How much to add to the date. 123 119 … … 203 199 204 200 dojo.date.difference = function(/*Date*/date1, /*Date?*/date2, /*String?*/interval){ 205 // summary:206 // Get the difference in a specific unit of time (e.g., number of months, weeks,207 // days, etc.) between two dates, rounded to the nearest integer.208 // 209 // date1:201 // summary: 202 // Get the difference in a specific unit of time (e.g., number of 203 // months, weeks, days, etc.) between two dates, rounded to the 204 // nearest integer. 205 // date1: 210 206 // Date object 211 // 212 // date2: 207 // date2: 213 208 // Date object. If not specified, the current Date is used. 214 // 215 // interval: 209 // interval: 216 210 // A string representing the interval. One of the following: 217 // "year", "month", "day", "hour", "minute", "second", "millisecond", "quarter", "week", "weekday" 211 // "year", "month", "day", "hour", "minute", "second", 212 // "millisecond", "quarter", "week", "weekday" 218 213 // Defaults to "day". 219 214