commit extjs-2.2.1
[extjs.git] / docs / output / Date.html
1         <div class="body-wrap">
2         <div class="top-tools">
3             <a class="inner-link" href="#Date-props"><img src="../resources/images/default/s.gif" class="item-icon icon-prop">Properties</a>
4             <a class="inner-link" href="#Date-methods"><img src="../resources/images/default/s.gif" class="item-icon icon-method">Methods</a>
5             <a class="inner-link" href="#Date-events"><img src="../resources/images/default/s.gif" class="item-icon icon-event">Events</a>
6                         <a class="bookmark" href="../docs/?class=Date"><img src="../resources/images/default/s.gif" class="item-icon icon-fav">Direct Link</a>
7         </div>
8                 <h1>Class Date</h1>
9         <table cellspacing="0">
10             <tr><td class="label">Package:</td><td class="hd-info">Global</td></tr>
11             <tr><td class="label">Defined In:</td><td class="hd-info"><a href="../src/Date.js" target="_blank">Date.js</a></td></tr>
12             <tr><td class="label">Class:</td><td class="hd-info">Date</td></tr>
13                                     <tr><td class="label">Extends:</td><td class="hd-info">Object</td></tr>
14                     </table>
15         <div class="description">
16             *
17 The date parsing and format syntax is a subset of
18 <a href="http://www.php.net/date">PHP's date() function</a>, and the formats that are
19 supported will provide results equivalent to their PHP versions.
20 The following is a list of all currently supported formats:
21 <pre>Format  Description                                                               Example returned values\r
22 ------  -----------------------------------------------------------------------   -----------------------\r
23   d     Day of the month, 2 digits with leading zeros                             01 to 31\r
24   D     A short textual representation of the day of the week                     Mon to Sun\r
25   j     Day of the month without leading zeros                                    1 to 31\r
26   l     A full textual representation of the day of the week                      Sunday to Saturday\r
27   N     ISO-8601 numeric representation of the day of the week                    1 (for Monday) through 7 (for Sunday)\r
28   S     English ordinal suffix for the day of the month, 2 characters             st, nd, rd or th. Works well with j\r
29   w     Numeric representation of the day of the week                             0 (for Sunday) to 6 (for Saturday)\r
30   z     The day of the year (starting from 0)                                     0 to 364 (365 in leap years)\r
31   W     ISO-8601 week number of year, weeks starting on Monday                    01 to 53\r
32   F     A full textual representation of a month, such as January or March        January to December\r
33   m     Numeric representation of a month, with leading zeros                     01 to 12\r
34   M     A short textual representation of a month                                 Jan to Dec\r
35   n     Numeric representation of a month, without leading zeros                  1 to 12\r
36   t     Number of days in the given month                                         28 to 31\r
37   L     Whether it's a leap year                                                  1 if it is a leap year, 0 otherwise.\r
38   o     ISO-8601 year number (identical to (Y), but if the ISO week number (W)    Examples: 1998 or 2004\r
39         belongs to the previous or next year, that year is used instead)\r
40   Y     A full numeric representation of a year, 4 digits                         Examples: 1999 or 2003\r
41   y     A two digit representation of a year                                      Examples: 99 or 03\r
42   a     Lowercase Ante meridiem and Post meridiem                                 am or pm\r
43   A     Uppercase Ante meridiem and Post meridiem                                 AM or PM\r
44   g     12-hour format of an hour without leading zeros                           1 to 12\r
45   G     24-hour format of an hour without leading zeros                           0 to 23\r
46   h     12-hour format of an hour with leading zeros                              01 to 12\r
47   H     24-hour format of an hour with leading zeros                              00 to 23\r
48   i     Minutes, with leading zeros                                               00 to 59\r
49   s     Seconds, with leading zeros                                               00 to 59\r
50   u     Decimal fraction of a second                                              Examples:\r
51         (minimum 1 digit, arbitrary number of digits allowed)                     001 (i.e. 0.001s) or\r
52                                                                                   100 (i.e. 0.100s) or\r
53                                                                                   999 (i.e. 0.999s) or\r
54                                                                                   999876543210 (i.e. 0.999876543210s)\r
55   O     Difference to Greenwich time (GMT) in hours and minutes                   Example: +1030\r
56   P     Difference to Greenwich time (GMT) with colon between hours and minutes   Example: -08:00\r
57   T     Timezone abbreviation of the machine running the code                     Examples: EST, MDT, PDT ...\r
58   Z     Timezone offset in seconds (negative if west of UTC, positive if east)    -43200 to 50400\r
59   c     ISO 8601 date (note: the decimal fraction of a second, if specified,      Examples:\r
60         must contain at least 1 digit. There is no limit on the maximum number    2007-04-17T15:19:21+08:00 or\r
61         of digits allowed. see http://www.w3.org/TR/NOTE-datetime for more info)  2008-03-16T16:18:22Z or\r
62                                                                                   2009-02-15T17:17:23.9+01:00 or\r
63                                                                                   2010-01-14T18:16:24,999876543-07:00\r
64   U     Seconds since the Unix Epoch (January 1 1970 00:00:00 GMT)                1193432466 or -2138434463</pre>
65 Example usage (note that you must escape format specifiers with '\\' to render them as character literals):
66 <pre><code><i>// Sample date:</i>
67 <i>// <em>'Wed Jan 10 2007 15:05:01 GMT-0600 (Central Standard Time)'</em></i>
68
69 <b>var</b> dt = <b>new</b> Date(<em>'1/10/2007 03:05:01 PM GMT-0600'</em>);
70 document.write(dt.format(<em>'Y-m-d'</em>));                           <i>// 2007-01-10</i>
71 document.write(dt.format(<em>'F j, Y, g:i a'</em>));                   <i>// January 10, 2007, 3:05 pm</i>
72 document.write(dt.format(<em>'l, \\t\\he jS \\of F Y h:i:s A'</em>));  // Wednesday, the 10th of January 2007 03:05:01 PM</code></pre>
73 Here are some standard date/time patterns that you might find helpful.  They
74 are not part of the source of Date.js, but to use them you can simply copy this
75 block of code into any script that is included after Date.js and they will also become
76 globally available on the Date object.  Feel free to add or remove patterns as needed in your code.
77 <pre><code>Date.patterns = {
78     ISO8601Long:<em>"Y-m-d H:i:s"</em>,
79     ISO8601Short:<em>"Y-m-d"</em>,
80     ShortDate: <em>"n/j/Y"</em>,
81     LongDate: <em>"l, F d, Y"</em>,
82     FullDateTime: <em>"l, F d, Y g:i:s A"</em>,
83     MonthDay: <em>"F d"</em>,
84     ShortTime: <em>"g:i A"</em>,
85     LongTime: <em>"g:i:s A"</em>,
86     SortableDateTime: <em>"Y-m-d\\TH:i:s"</em>,
87     UniversalSortableDateTime: <em>"Y-m-d H:i:sO"</em>,
88     YearMonth: <em>"F, Y"</em>
89 };</code></pre>
90 Example usage:
91 <pre><code>var dt = <b>new</b> Date();
92 document.write(dt.format(Date.patterns.ShortDate));</code></pre>        </div>
93         
94         <div class="hr"></div>
95                 <a id="Date-props"></a>
96         <h2>Public Properties</h2>
97                 <table cellspacing="0" class="member-table">
98             <tr>
99                 <th class="sig-header" colspan="2">Property</th>
100                 <th class="msource-header">Defined By</th>
101             </tr>
102                 <tr class="property-row">\r
103         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
104         <td class="sig">\r
105         <a id="Date-DAY"></a>\r
106             <b>DAY</b> : String            <div class="mdesc">\r
107                             &lt;static&gt; Date interval constant                        </div>\r
108         </td>\r
109         <td class="msource">Date</td>\r
110     </tr>\r
111         <tr class="property-row alt">\r
112         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
113         <td class="sig">\r
114         <a id="Date-HOUR"></a>\r
115             <b>HOUR</b> : String            <div class="mdesc">\r
116                             &lt;static&gt; Date interval constant                        </div>\r
117         </td>\r
118         <td class="msource">Date</td>\r
119     </tr>\r
120         <tr class="property-row">\r
121         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
122         <td class="sig">\r
123         <a id="Date-MILLI"></a>\r
124             <b>MILLI</b> : String            <div class="mdesc">\r
125                             &lt;static&gt; Date interval constant                        </div>\r
126         </td>\r
127         <td class="msource">Date</td>\r
128     </tr>\r
129         <tr class="property-row alt">\r
130         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
131         <td class="sig">\r
132         <a id="Date-MINUTE"></a>\r
133             <b>MINUTE</b> : String            <div class="mdesc">\r
134                             &lt;static&gt; Date interval constant                        </div>\r
135         </td>\r
136         <td class="msource">Date</td>\r
137     </tr>\r
138         <tr class="property-row">\r
139         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
140         <td class="sig">\r
141         <a id="Date-MONTH"></a>\r
142             <b>MONTH</b> : String            <div class="mdesc">\r
143                             &lt;static&gt; Date interval constant                        </div>\r
144         </td>\r
145         <td class="msource">Date</td>\r
146     </tr>\r
147         <tr class="property-row alt">\r
148         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
149         <td class="sig">\r
150         <a id="Date-SECOND"></a>\r
151             <b>SECOND</b> : String            <div class="mdesc">\r
152                             &lt;static&gt; Date interval constant                        </div>\r
153         </td>\r
154         <td class="msource">Date</td>\r
155     </tr>\r
156         <tr class="property-row">\r
157         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
158         <td class="sig">\r
159         <a id="Date-YEAR"></a>\r
160             <b>YEAR</b> : String            <div class="mdesc">\r
161                             &lt;static&gt; Date interval constant                        </div>\r
162         </td>\r
163         <td class="msource">Date</td>\r
164     </tr>\r
165         <tr class="property-row alt expandable">\r
166         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
167         <td class="sig">\r
168         <a id="Date-dayNames"></a>\r
169             <b>dayNames</b> : Array            <div class="mdesc">\r
170                         <div class="short">&lt;static&gt; An array of textual day names.
171 Override these values for international dates.
172 Example:
173 Date.dayNames =...</div>\r
174             <div class="long">\r
175                 &lt;static&gt; An array of textual day names.
176 Override these values for international dates.
177 Example:
178 <pre><code>Date.dayNames = [
179       <em>'SundayInYourLang'</em>,
180       <em>'MondayInYourLang'</em>,
181       ...
182     ];</code></pre>            </div>\r
183                         </div>\r
184         </td>\r
185         <td class="msource">Date</td>\r
186     </tr>\r
187         <tr class="property-row expandable">\r
188         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
189         <td class="sig">\r
190         <a id="Date-formatCodes"></a>\r
191             <b>formatCodes</b> : Object            <div class="mdesc">\r
192                         <div class="short">&lt;static&gt; The base format-code to formatting-function hashmap used by the format method.
193 Formatting functions ar...</div>\r
194             <div class="long">\r
195                 &lt;static&gt; The base format-code to formatting-function hashmap used by the <a ext:cls="Date" ext:member="format" href="output/Date.html#format">format</a> method.
196 Formatting functions are strings (or functions which return strings) which
197 will return the appropriate value when evaluated in the context of the Date object
198 from which the <a ext:cls="Date" ext:member="format" href="output/Date.html#format">format</a> method is called.
199 Add to / override these mappings for custom date formatting.
200 Note: Date.format() treats characters as literals if an appropriate mapping cannot be found.
201 Example:\r
202     <pre><code>Date.formatCodes.x = <em>"String.leftPad(<b>this</b>.getDate(), 2, '0')"</em>;
203     (<b>new</b> Date()).format(<em>"X"</em>); // returns the current day of the month</code></pre>            </div>\r
204                         </div>\r
205         </td>\r
206         <td class="msource">Date</td>\r
207     </tr>\r
208         <tr class="property-row alt expandable">\r
209         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
210         <td class="sig">\r
211         <a id="Date-monthNames"></a>\r
212             <b>monthNames</b> : Array            <div class="mdesc">\r
213                         <div class="short">&lt;static&gt; An array of textual month names.
214 Override these values for international dates.
215 Example:
216 Date.monthNam...</div>\r
217             <div class="long">\r
218                 &lt;static&gt; An array of textual month names.
219 Override these values for international dates.
220 Example:
221 <pre><code>Date.monthNames = [
222       <em>'JanInYourLang'</em>,
223       <em>'FebInYourLang'</em>,
224       ...
225     ];</code></pre>            </div>\r
226                         </div>\r
227         </td>\r
228         <td class="msource">Date</td>\r
229     </tr>\r
230         <tr class="property-row expandable">\r
231         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
232         <td class="sig">\r
233         <a id="Date-monthNumbers"></a>\r
234             <b>monthNumbers</b> : Object            <div class="mdesc">\r
235                         <div class="short">&lt;static&gt; An object hash of zero-based javascript month numbers (with short month names as keys. note: keys are ...</div>\r
236             <div class="long">\r
237                 &lt;static&gt; An object hash of zero-based javascript month numbers (with short month names as keys. note: keys are case-sensitive).
238 Override these values for international dates.
239 Example:
240 <pre><code>Date.monthNumbers = {
241       <em>'ShortJanNameInYourLang'</em>:0,
242       <em>'ShortFebNameInYourLang'</em>:1,
243       ...
244     };</code></pre>            </div>\r
245                         </div>\r
246         </td>\r
247         <td class="msource">Date</td>\r
248     </tr>\r
249             </table>
250                 <a id="Date-methods"></a>
251         <h2>Public Methods</h2>
252                 <table cellspacing="0" class="member-table">
253             <tr>
254                 <th class="sig-header" colspan="2">Method</th>
255                 <th class="msource-header">Defined By</th>
256             </tr>
257                 <tr class="method-row expandable">\r
258         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
259         <td class="sig">\r
260         <a id="Date-add"></a>\r
261             <b>add</b>(&nbsp;<code>String interval</code>, <code>Number value</code>&nbsp;) : Date            <div class="mdesc">\r
262                         <div class="short">Provides a convenient method of performing basic date arithmetic.  This method
263 does not modify the Date instance bein...</div>\r
264             <div class="long">\r
265                 Provides a convenient method of performing basic date arithmetic.  This method
266 does not modify the Date instance being called - it creates and returns
267 a new Date instance containing the resulting date value.
268 Examples:
269 <pre><code><i>//Basic usage:</i>
270     <b>var</b> dt = <b>new</b> Date(<em>'10/29/2006'</em>).add(Date.DAY, 5);
271     document.write(dt); <i>//returns <em>'Fri Oct 06 2006 00:00:00'</em></i>
272
273     <i>//Negative values will subtract correctly:</i>
274     <b>var</b> dt2 = <b>new</b> Date(<em>'10/1/2006'</em>).add(Date.DAY, -5);
275     document.write(dt2); <i>//returns <em>'Tue Sep 26 2006 00:00:00'</em></i>
276
277     <i>//You can even chain several calls together <b>in</b> one line!</i>
278     <b>var</b> dt3 = <b>new</b> Date(<em>'10/1/2006'</em>).add(Date.DAY, 5).add(Date.HOUR, 8).add(Date.MINUTE, -30);
279     document.write(dt3); //returns <em>'Fri Oct 06 2006 07:30:00'</em></code></pre>    <div class="mdetail-params">\r
280         <strong>Parameters:</strong>\r
281         <ul><li><code>interval</code> : String<div class="sub-desc">A valid date interval enum value.</div></li><li><code>value</code> : Number<div class="sub-desc">The amount to add to the current date.</div></li>        </ul>\r
282         <strong>Returns:</strong>\r
283         <ul>\r
284             <li><code>Date</code><div class="sub-desc">The new Date instance.</div></li>\r
285         </ul>\r
286     </div>\r
287                 </div>\r
288                         </div>\r
289         </td>\r
290         <td class="msource">Date</td>\r
291     </tr>\r
292         <tr class="method-row alt expandable">\r
293         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
294         <td class="sig">\r
295         <a id="Date-between"></a>\r
296             <b>between</b>(&nbsp;<code>Date start</code>, <code>Date end</code>&nbsp;) : Boolean            <div class="mdesc">\r
297                         <div class="short">Checks if this date falls on or between the given start and end dates.</div>\r
298             <div class="long">\r
299                 Checks if this date falls on or between the given start and end dates.    <div class="mdetail-params">\r
300         <strong>Parameters:</strong>\r
301         <ul><li><code>start</code> : Date<div class="sub-desc">Start date</div></li><li><code>end</code> : Date<div class="sub-desc">End date</div></li>        </ul>\r
302         <strong>Returns:</strong>\r
303         <ul>\r
304             <li><code>Boolean</code><div class="sub-desc">true if this date falls on or between the given start and end dates.</div></li>\r
305         </ul>\r
306     </div>\r
307                 </div>\r
308                         </div>\r
309         </td>\r
310         <td class="msource">Date</td>\r
311     </tr>\r
312         <tr class="method-row expandable">\r
313         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
314         <td class="sig">\r
315         <a id="Date-clearTime"></a>\r
316             <b>clearTime</b>(&nbsp;<code>Boolean clone</code>&nbsp;) : Date            <div class="mdesc">\r
317                         <div class="short">Clears any time information from this date.</div>\r
318             <div class="long">\r
319                 Clears any time information from this date.    <div class="mdetail-params">\r
320         <strong>Parameters:</strong>\r
321         <ul><li><code>clone</code> : Boolean<div class="sub-desc">true to create a clone of this date, clear the time and return it (defaults to false).</div></li>        </ul>\r
322         <strong>Returns:</strong>\r
323         <ul>\r
324             <li><code>Date</code><div class="sub-desc">this or the clone.</div></li>\r
325         </ul>\r
326     </div>\r
327                 </div>\r
328                         </div>\r
329         </td>\r
330         <td class="msource">Date</td>\r
331     </tr>\r
332         <tr class="method-row alt expandable">\r
333         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
334         <td class="sig">\r
335         <a id="Date-clone"></a>\r
336             <b>clone</b>() : Date            <div class="mdesc">\r
337                         <div class="short">Creates and returns a new Date instance with the exact same date value as the called instance.
338 Dates are copied and p...</div>\r
339             <div class="long">\r
340                 Creates and returns a new Date instance with the exact same date value as the called instance.
341 Dates are copied and passed by reference, so if a copied date variable is modified later, the original
342 variable will also be changed.  When the intention is to create a new variable that will not
343 modify the original instance, you should create a clone.
344 Example of correctly cloning a date:
345 <pre><code><i>//wrong way:</i>
346     <b>var</b> orig = <b>new</b> Date(<em>'10/1/2006'</em>);
347     <b>var</b> copy = orig;
348     copy.setDate(5);
349     document.write(orig);  <i>//returns <em>'Thu Oct 05 2006'</em>!</i>
350
351     <i>//correct way:</i>
352     <b>var</b> orig = <b>new</b> Date(<em>'10/1/2006'</em>);
353     <b>var</b> copy = orig.clone();
354     copy.setDate(5);
355     document.write(orig);  //returns <em>'Thu Oct 01 2006'</em></code></pre>    <div class="mdetail-params">\r
356         <strong>Parameters:</strong>\r
357         <ul><li>None.</li>        </ul>\r
358         <strong>Returns:</strong>\r
359         <ul>\r
360             <li><code>Date</code><div class="sub-desc">The new Date instance.</div></li>\r
361         </ul>\r
362     </div>\r
363                 </div>\r
364                         </div>\r
365         </td>\r
366         <td class="msource">Date</td>\r
367     </tr>\r
368         <tr class="method-row expandable">\r
369         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
370         <td class="sig">\r
371         <a id="Date-format"></a>\r
372             <b>format</b>(&nbsp;<code>String format</code>&nbsp;) : String            <div class="mdesc">\r
373                         <div class="short">Formats a date given the supplied format string.</div>\r
374             <div class="long">\r
375                 Formats a date given the supplied format string.    <div class="mdetail-params">\r
376         <strong>Parameters:</strong>\r
377         <ul><li><code>format</code> : String<div class="sub-desc">The format string.</div></li>        </ul>\r
378         <strong>Returns:</strong>\r
379         <ul>\r
380             <li><code>String</code><div class="sub-desc">The formatted date.</div></li>\r
381         </ul>\r
382     </div>\r
383                 </div>\r
384                         </div>\r
385         </td>\r
386         <td class="msource">Date</td>\r
387     </tr>\r
388         <tr class="method-row alt expandable">\r
389         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
390         <td class="sig">\r
391         <a id="Date-getDayOfYear"></a>\r
392             <b>getDayOfYear</b>() : Number            <div class="mdesc">\r
393                         <div class="short">Get the numeric day number of the year, adjusted for leap year.</div>\r
394             <div class="long">\r
395                 Get the numeric day number of the year, adjusted for leap year.    <div class="mdetail-params">\r
396         <strong>Parameters:</strong>\r
397         <ul><li>None.</li>        </ul>\r
398         <strong>Returns:</strong>\r
399         <ul>\r
400             <li><code>Number</code><div class="sub-desc">0 to 364 (365 in leap years).</div></li>\r
401         </ul>\r
402     </div>\r
403                 </div>\r
404                         </div>\r
405         </td>\r
406         <td class="msource">Date</td>\r
407     </tr>\r
408         <tr class="method-row expandable">\r
409         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
410         <td class="sig">\r
411         <a id="Date-getDaysInMonth"></a>\r
412             <b>getDaysInMonth</b>() : Number            <div class="mdesc">\r
413                         <div class="short">Get the number of days in the current month, adjusted for leap year.</div>\r
414             <div class="long">\r
415                 Get the number of days in the current month, adjusted for leap year.    <div class="mdetail-params">\r
416         <strong>Parameters:</strong>\r
417         <ul><li>None.</li>        </ul>\r
418         <strong>Returns:</strong>\r
419         <ul>\r
420             <li><code>Number</code><div class="sub-desc">The number of days in the month.</div></li>\r
421         </ul>\r
422     </div>\r
423                 </div>\r
424                         </div>\r
425         </td>\r
426         <td class="msource">Date</td>\r
427     </tr>\r
428         <tr class="method-row alt expandable">\r
429         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
430         <td class="sig">\r
431         <a id="Date-getElapsed"></a>\r
432             <b>getElapsed</b>(&nbsp;<span class="optional" title="Optional">[<code>Date date</code>]</span>&nbsp;) : Number            <div class="mdesc">\r
433                         <div class="short">Returns the number of milliseconds between this date and date</div>\r
434             <div class="long">\r
435                 Returns the number of milliseconds between this date and date    <div class="mdetail-params">\r
436         <strong>Parameters:</strong>\r
437         <ul><li><code>date</code> : Date<div class="sub-desc">(optional) Defaults to now</div></li>        </ul>\r
438         <strong>Returns:</strong>\r
439         <ul>\r
440             <li><code>Number</code><div class="sub-desc">The diff in milliseconds</div></li>\r
441         </ul>\r
442     </div>\r
443                 </div>\r
444                         </div>\r
445         </td>\r
446         <td class="msource">Date</td>\r
447     </tr>\r
448         <tr class="method-row expandable">\r
449         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
450         <td class="sig">\r
451         <a id="Date-getFirstDateOfMonth"></a>\r
452             <b>getFirstDateOfMonth</b>() : Date            <div class="mdesc">\r
453                         <div class="short">Get the date of the first day of the month in which this date resides.</div>\r
454             <div class="long">\r
455                 Get the date of the first day of the month in which this date resides.    <div class="mdetail-params">\r
456         <strong>Parameters:</strong>\r
457         <ul><li>None.</li>        </ul>\r
458         <strong>Returns:</strong>\r
459         <ul>\r
460             <li><code>Date</code></li>\r
461         </ul>\r
462     </div>\r
463                 </div>\r
464                         </div>\r
465         </td>\r
466         <td class="msource">Date</td>\r
467     </tr>\r
468         <tr class="method-row alt expandable">\r
469         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
470         <td class="sig">\r
471         <a id="Date-getFirstDayOfMonth"></a>\r
472             <b>getFirstDayOfMonth</b>() : Number            <div class="mdesc">\r
473                         <div class="short">Get the first day of the current month, adjusted for leap year.  The returned value
474 is the numeric day index within t...</div>\r
475             <div class="long">\r
476                 Get the first day of the current month, adjusted for leap year.  The returned value
477 is the numeric day index within the week (0-6) which can be used in conjunction with
478 the <a ext:cls="Date" ext:member="monthNames" href="output/Date.html#monthNames">monthNames</a> array to retrieve the textual day name.
479 Example:
480 <pre><code>var dt = <b>new</b> Date(<em>'1/10/2007'</em>);
481     document.write(Date.dayNames[dt.getFirstDayOfMonth()]); //output: <em>'Monday'</em></code></pre>    <div class="mdetail-params">\r
482         <strong>Parameters:</strong>\r
483         <ul><li>None.</li>        </ul>\r
484         <strong>Returns:</strong>\r
485         <ul>\r
486             <li><code>Number</code><div class="sub-desc">The day number (0-6).</div></li>\r
487         </ul>\r
488     </div>\r
489                 </div>\r
490                         </div>\r
491         </td>\r
492         <td class="msource">Date</td>\r
493     </tr>\r
494         <tr class="method-row expandable">\r
495         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
496         <td class="sig">\r
497         <a id="Date-getGMTOffset"></a>\r
498             <b>getGMTOffset</b>(&nbsp;<code>Boolean colon</code>&nbsp;) : String            <div class="mdesc">\r
499                         <div class="short">Get the offset from GMT of the current date (equivalent to the format specifier 'O').</div>\r
500             <div class="long">\r
501                 Get the offset from GMT of the current date (equivalent to the format specifier 'O').    <div class="mdetail-params">\r
502         <strong>Parameters:</strong>\r
503         <ul><li><code>colon</code> : Boolean<div class="sub-desc">true to separate the hours and minutes with a colon (defaults to false).</div></li>        </ul>\r
504         <strong>Returns:</strong>\r
505         <ul>\r
506             <li><code>String</code><div class="sub-desc">The 4-character offset string prefixed with + or - (e.g. '-0600').</div></li>\r
507         </ul>\r
508     </div>\r
509                 </div>\r
510                         </div>\r
511         </td>\r
512         <td class="msource">Date</td>\r
513     </tr>\r
514         <tr class="method-row alt expandable">\r
515         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
516         <td class="sig">\r
517         <a id="Date-getLastDateOfMonth"></a>\r
518             <b>getLastDateOfMonth</b>() : Date            <div class="mdesc">\r
519                         <div class="short">Get the date of the last day of the month in which this date resides.</div>\r
520             <div class="long">\r
521                 Get the date of the last day of the month in which this date resides.    <div class="mdetail-params">\r
522         <strong>Parameters:</strong>\r
523         <ul><li>None.</li>        </ul>\r
524         <strong>Returns:</strong>\r
525         <ul>\r
526             <li><code>Date</code></li>\r
527         </ul>\r
528     </div>\r
529                 </div>\r
530                         </div>\r
531         </td>\r
532         <td class="msource">Date</td>\r
533     </tr>\r
534         <tr class="method-row expandable">\r
535         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
536         <td class="sig">\r
537         <a id="Date-getLastDayOfMonth"></a>\r
538             <b>getLastDayOfMonth</b>() : Number            <div class="mdesc">\r
539                         <div class="short">Get the last day of the current month, adjusted for leap year.  The returned value
540 is the numeric day index within th...</div>\r
541             <div class="long">\r
542                 Get the last day of the current month, adjusted for leap year.  The returned value
543 is the numeric day index within the week (0-6) which can be used in conjunction with
544 the <a ext:cls="Date" ext:member="monthNames" href="output/Date.html#monthNames">monthNames</a> array to retrieve the textual day name.
545 Example:
546 <pre><code>var dt = <b>new</b> Date(<em>'1/10/2007'</em>);
547     document.write(Date.dayNames[dt.getLastDayOfMonth()]); //output: <em>'Wednesday'</em></code></pre>    <div class="mdetail-params">\r
548         <strong>Parameters:</strong>\r
549         <ul><li>None.</li>        </ul>\r
550         <strong>Returns:</strong>\r
551         <ul>\r
552             <li><code>Number</code><div class="sub-desc">The day number (0-6).</div></li>\r
553         </ul>\r
554     </div>\r
555                 </div>\r
556                         </div>\r
557         </td>\r
558         <td class="msource">Date</td>\r
559     </tr>\r
560         <tr class="method-row alt expandable">\r
561         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
562         <td class="sig">\r
563         <a id="Date-getMonthNumber"></a>\r
564             <b>getMonthNumber</b>(&nbsp;<code>String name</code>&nbsp;) : Number            <div class="mdesc">\r
565                         <div class="short">&lt;static&gt; Get the zero-based javascript month number for the given short/full month name.
566 Override this function...</div>\r
567             <div class="long">\r
568                 &lt;static&gt; Get the zero-based javascript month number for the given short/full month name.
569 Override this function for international dates.    <div class="mdetail-params">\r
570         <strong>Parameters:</strong>\r
571         <ul><li><code>name</code> : String<div class="sub-desc">The short/full month name.</div></li>        </ul>\r
572         <strong>Returns:</strong>\r
573         <ul>\r
574             <li><code>Number</code><div class="sub-desc">The zero-based javascript month number.</div></li>\r
575         </ul>\r
576     </div>\r
577                 </div>\r
578                         </div>\r
579         </td>\r
580         <td class="msource">Date</td>\r
581     </tr>\r
582         <tr class="method-row expandable">\r
583         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
584         <td class="sig">\r
585         <a id="Date-getShortDayName"></a>\r
586             <b>getShortDayName</b>(&nbsp;<code>Number day</code>&nbsp;) : String            <div class="mdesc">\r
587                         <div class="short">&lt;static&gt; Get the short day name for the given day number.
588 Override this function for international dates.</div>\r
589             <div class="long">\r
590                 &lt;static&gt; Get the short day name for the given day number.
591 Override this function for international dates.    <div class="mdetail-params">\r
592         <strong>Parameters:</strong>\r
593         <ul><li><code>day</code> : Number<div class="sub-desc">A zero-based javascript day number.</div></li>        </ul>\r
594         <strong>Returns:</strong>\r
595         <ul>\r
596             <li><code>String</code><div class="sub-desc">The short day name.</div></li>\r
597         </ul>\r
598     </div>\r
599                 </div>\r
600                         </div>\r
601         </td>\r
602         <td class="msource">Date</td>\r
603     </tr>\r
604         <tr class="method-row alt expandable">\r
605         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
606         <td class="sig">\r
607         <a id="Date-getShortMonthName"></a>\r
608             <b>getShortMonthName</b>(&nbsp;<code>Number month</code>&nbsp;) : String            <div class="mdesc">\r
609                         <div class="short">&lt;static&gt; Get the short month name for the given month number.
610 Override this function for international dates.</div>\r
611             <div class="long">\r
612                 &lt;static&gt; Get the short month name for the given month number.
613 Override this function for international dates.    <div class="mdetail-params">\r
614         <strong>Parameters:</strong>\r
615         <ul><li><code>month</code> : Number<div class="sub-desc">A zero-based javascript month number.</div></li>        </ul>\r
616         <strong>Returns:</strong>\r
617         <ul>\r
618             <li><code>String</code><div class="sub-desc">The short month name.</div></li>\r
619         </ul>\r
620     </div>\r
621                 </div>\r
622                         </div>\r
623         </td>\r
624         <td class="msource">Date</td>\r
625     </tr>\r
626         <tr class="method-row expandable">\r
627         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
628         <td class="sig">\r
629         <a id="Date-getSuffix"></a>\r
630             <b>getSuffix</b>() : String            <div class="mdesc">\r
631                         <div class="short">Get the English ordinal suffix of the current day (equivalent to the format specifier 'S').</div>\r
632             <div class="long">\r
633                 Get the English ordinal suffix of the current day (equivalent to the format specifier 'S').    <div class="mdetail-params">\r
634         <strong>Parameters:</strong>\r
635         <ul><li>None.</li>        </ul>\r
636         <strong>Returns:</strong>\r
637         <ul>\r
638             <li><code>String</code><div class="sub-desc">'st, 'nd', 'rd' or 'th'.</div></li>\r
639         </ul>\r
640     </div>\r
641                 </div>\r
642                         </div>\r
643         </td>\r
644         <td class="msource">Date</td>\r
645     </tr>\r
646         <tr class="method-row alt expandable">\r
647         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
648         <td class="sig">\r
649         <a id="Date-getTimezone"></a>\r
650             <b>getTimezone</b>() : String            <div class="mdesc">\r
651                         <div class="short">Get the timezone abbreviation of the current date (equivalent to the format specifier 'T').
652 Note: The date string ret...</div>\r
653             <div class="long">\r
654                 Get the timezone abbreviation of the current date (equivalent to the format specifier 'T').
655 Note: The date string returned by the javascript Date object's toString() method varies
656 between browsers (e.g. FF vs IE) and system region settings (e.g. IE in Asia vs IE in America).
657 For a given date string e.g. "Thu Oct 25 2007 22:55:35 GMT+0800 (Malay Peninsula Standard Time)",
658 getTimezone() first tries to get the timezone abbreviation from between a pair of parentheses
659 (which may or may not be present), failing which it proceeds to get the timezone abbreviation
660 from the GMT offset portion of the date string.    <div class="mdetail-params">\r
661         <strong>Parameters:</strong>\r
662         <ul><li>None.</li>        </ul>\r
663         <strong>Returns:</strong>\r
664         <ul>\r
665             <li><code>String</code><div class="sub-desc">The abbreviated timezone name (e.g. 'CST', 'PDT', 'EDT', 'MPST' ...).</div></li>\r
666         </ul>\r
667     </div>\r
668                 </div>\r
669                         </div>\r
670         </td>\r
671         <td class="msource">Date</td>\r
672     </tr>\r
673         <tr class="method-row expandable">\r
674         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
675         <td class="sig">\r
676         <a id="Date-getWeekOfYear"></a>\r
677             <b>getWeekOfYear</b>() : Number            <div class="mdesc">\r
678                         <div class="short">Get the numeric ISO-8601 week number of the year.
679 (equivalent to the format specifier 'W', but without a leading zero).</div>\r
680             <div class="long">\r
681                 Get the numeric ISO-8601 week number of the year.
682 (equivalent to the format specifier 'W', but without a leading zero).    <div class="mdetail-params">\r
683         <strong>Parameters:</strong>\r
684         <ul><li>None.</li>        </ul>\r
685         <strong>Returns:</strong>\r
686         <ul>\r
687             <li><code>Number</code><div class="sub-desc">1 to 53</div></li>\r
688         </ul>\r
689     </div>\r
690                 </div>\r
691                         </div>\r
692         </td>\r
693         <td class="msource">Date</td>\r
694     </tr>\r
695         <tr class="method-row alt expandable">\r
696         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
697         <td class="sig">\r
698         <a id="Date-isLeapYear"></a>\r
699             <b>isLeapYear</b>() : Boolean            <div class="mdesc">\r
700                         <div class="short">Whether or not the current date is in a leap year.</div>\r
701             <div class="long">\r
702                 Whether or not the current date is in a leap year.    <div class="mdetail-params">\r
703         <strong>Parameters:</strong>\r
704         <ul><li>None.</li>        </ul>\r
705         <strong>Returns:</strong>\r
706         <ul>\r
707             <li><code>Boolean</code><div class="sub-desc">True if the current date is in a leap year, else false.</div></li>\r
708         </ul>\r
709     </div>\r
710                 </div>\r
711                         </div>\r
712         </td>\r
713         <td class="msource">Date</td>\r
714     </tr>\r
715         <tr class="method-row expandable">\r
716         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
717         <td class="sig">\r
718         <a id="Date-parseDate"></a>\r
719             <b>parseDate</b>(&nbsp;<code>String input</code>, <code>String format</code>&nbsp;) : Date            <div class="mdesc">\r
720                         <div class="short">&lt;static&gt; Parses the passed string using the specified format. Note that this function expects dates in normal c...</div>\r
721             <div class="long">\r
722                 &lt;static&gt; Parses the passed string using the specified format. Note that this function expects dates in normal calendar
723 format, meaning that months are 1-based (1 = January) and not zero-based like in JavaScript dates.  Any part of
724 the date format that is not specified will default to the current date value for that part.  Time parts can also
725 be specified, but default to 0.  Keep in mind that the input date string must precisely match the specified format
726 string or the parse operation will fail.
727 Example Usage:
728 <pre><code><i>//dt = Fri May 25 2007 (current date)</i>
729     <b>var</b> dt = <b>new</b> Date();
730
731     <i>//dt = Thu May 25 2006 (today's month/day <b>in</b> 2006)</i>
732     dt = Date.parseDate(<em>"2006"</em>, <em>"Y"</em>);
733
734     <i>//dt = Sun Jan 15 2006 (all date parts specified)</i>
735     dt = Date.parseDate(<em>"2006-01-15"</em>, <em>"Y-m-d"</em>);
736
737     <i>//dt = Sun Jan 15 2006 15:20:01 GMT-0600 (CST)</i>
738     dt = Date.parseDate(<em>"2006-01-15 3:20:01 PM"</em>, <em>"Y-m-d h:i:s A"</em> );</code></pre>    <div class="mdetail-params">\r
739         <strong>Parameters:</strong>\r
740         <ul><li><code>input</code> : String<div class="sub-desc">The unparsed date as a string.</div></li><li><code>format</code> : String<div class="sub-desc">The format the date is in.</div></li>        </ul>\r
741         <strong>Returns:</strong>\r
742         <ul>\r
743             <li><code>Date</code><div class="sub-desc">The parsed date.</div></li>\r
744         </ul>\r
745     </div>\r
746                 </div>\r
747                         </div>\r
748         </td>\r
749         <td class="msource">Date</td>\r
750     </tr>\r
751             </table>
752                 <a id="Date-events"></a>
753         <h2>Public Events</h2>
754         <div class="no-members">This class has no public events.</div>
755         </div>