|
1 | | -TODO |
2 | | -------------------- |
3 | | -1. More work to be done on Timezone, Timezone offsets and DST (Summer Time) |
4 | | -
|
5 | | -2. Add .getFriendly() to TimeSpan and TimePeriod. Example |
6 | | -
|
7 | | - If a date was 3 days and 5 hours away from now, the TimeSpan getFriendly() function would return the following. |
8 | | - |
9 | | - var future = new Date().add({days: 3, hours: 5}); |
10 | | - var ts = new TimeSpan(future - new Date()); |
11 | | - |
12 | | - console.log(ts.getFriendly()); // "3 days and 5 hours from now" |
13 | | - |
14 | | -3. More tests! |
15 | | -
|
16 | | -
|
17 | | -
|
18 | | -CUTTING ROOM FLOOR |
19 | | -------------------- |
20 | | -
|
21 | | -The following items were at one time tested for inclusion into the library, but were cut. |
22 | | -They are documented here for reference. |
23 | | -
|
24 | | -1. Removed <static> Date.now() because of potential collision with the future ECMA 4 spec, which will include a Date.now() function. |
25 | | -
|
26 | | -2. Removed <static> Date.getDayName(dayOfWeek). Please use Date.CultureInfo.dayNames[dayOfWeek]. |
27 | | -
|
28 | | -3. Removed <static> Date.getMonthName(month). Please use Date.CultureInfo.monthNames[month]. |
29 | | - |
30 | | -2. Date.prototype.getQuarter() |
31 | | -
|
32 | | - /** |
33 | | - * Get the Year Quarter number for the currect date instance. |
34 | | - * @return {Number} 1 to 4 |
35 | | - */ |
36 | | - $P.getQuarter = function () { |
37 | | - return Math.ceil((this.getMonth() + 1)/3); |
38 | | - }; |
39 | | -
|
40 | | -3. Date.isDate(). Please use "instanceof". |
41 | | -
|
42 | | - Example |
43 | | - |
44 | | - var d1 = null; |
45 | | - d1 = Date.today(); |
46 | | - console.log(d1 instanceof Date); |
47 | | -
|
48 | | - /** |
49 | | - * Determines if an object is a Date object. |
50 | | - * @return {Boolean} true if object is a Date, otherwise false. |
51 | | - */ |
52 | | - $D.isDate = function (obj) { |
53 | | - return (obj instanceof Date); |
54 | | - }; |
55 | | -
|
56 | | - Another Version... |
57 | | -
|
58 | | - /** |
59 | | - * Determines if an object is a Date object. |
60 | | - * @return {Boolean} true if object is a Date, otherwise false. |
61 | | - */ |
62 | | - $D.isDate = function (obj) { |
63 | | - return (obj !== null) ? obj.constructor.toString().match(/Date/i) == "Date" : false; |
| 1 | +TODO |
| 2 | +------------------- |
| 3 | +1. DST (Summer Time) |
| 4 | + |
| 5 | +2. Add .getFriendly() to TimeSpan and TimePeriod. Example |
| 6 | + |
| 7 | + If a date was 3 days and 5 hours away from now, the TimeSpan getFriendly() function would return the following. |
| 8 | + |
| 9 | + var future = new Date().add({days: 3, hours: 5}); |
| 10 | + var ts = new TimeSpan(future - new Date()); |
| 11 | + |
| 12 | + console.log(ts.getFriendly()); // "3 days and 5 hours from now" |
| 13 | + |
| 14 | +3. More tests! |
| 15 | + |
| 16 | + |
| 17 | + |
| 18 | +CUTTING ROOM FLOOR |
| 19 | +------------------- |
| 20 | + |
| 21 | +The following items were at one time tested for inclusion into the library, but were cut. |
| 22 | +They are documented here for reference. |
| 23 | + |
| 24 | +1. Removed <static> Date.now() because of potential collision with the future ECMA 4 spec, which will include a Date.now() function. |
| 25 | + |
| 26 | +2. Removed <static> Date.getDayName(dayOfWeek). Please use Date.CultureInfo.dayNames[dayOfWeek]. |
| 27 | + |
| 28 | +3. Removed <static> Date.getMonthName(month). Please use Date.CultureInfo.monthNames[month]. |
| 29 | + |
| 30 | +2. Date.prototype.getQuarter() |
| 31 | + |
| 32 | + /** |
| 33 | + * Get the Year Quarter number for the currect date instance. |
| 34 | + * @return {Number} 1 to 4 |
| 35 | + */ |
| 36 | + $P.getQuarter = function () { |
| 37 | + return Math.ceil((this.getMonth() + 1)/3); |
| 38 | + }; |
| 39 | + |
| 40 | +3. Date.isDate(). Please use "instanceof". |
| 41 | + |
| 42 | + Example |
| 43 | + |
| 44 | + var d1 = null; |
| 45 | + d1 = Date.today(); |
| 46 | + console.log(d1 instanceof Date); |
| 47 | + |
| 48 | + /** |
| 49 | + * Determines if an object is a Date object. |
| 50 | + * @return {Boolean} true if object is a Date, otherwise false. |
| 51 | + */ |
| 52 | + $D.isDate = function (obj) { |
| 53 | + return (obj instanceof Date); |
| 54 | + }; |
| 55 | + |
| 56 | + Another Version... |
| 57 | + |
| 58 | + /** |
| 59 | + * Determines if an object is a Date object. |
| 60 | + * @return {Boolean} true if object is a Date, otherwise false. |
| 61 | + */ |
| 62 | + $D.isDate = function (obj) { |
| 63 | + return (obj !== null) ? obj.constructor.toString().match(/Date/i) == "Date" : false; |
64 | 64 | }; |
0 commit comments