You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
date.format(newDate(2020, 4, 5), pattern); // => May 5 2020
65
-
```
66
-
67
-
- The `parse()` now supports `...` (ellipsis) token. The `preparse()` and the `isValid()` are too.
68
-
69
-
```javascript
70
-
// Cannot write like this even if you want to get only a date part.
71
-
date.parse('Mar 05 2020 10:42:29 GMT-0800', 'MMM D YYYY'); // => Invalid Date
72
-
73
-
// Previously, it was necessary to adjust the length of the format string by appending white spaces of the same length as a part to ignore.
74
-
date.parse('Mar 05 2020 10:42:29 GMT-0800', 'MMM D YYYY ');
75
-
76
-
// Can write simply like this using the ellipsis token.
77
-
date.parse('Mar 05 2020 10:42:29 GMT-0800', 'MMM D YYYY...');
78
-
```
79
-
80
-
- Added `day-of-week` plugin for the parser. However this is a dummy, not effective at all. See [PLUGINS.md](./PLUGINS.md) for details.
81
-
82
-
```javascript
83
-
// If a date string has day of week at the head, cannot parse it unless remove that part from it or fill white spaces that part of the format string.
84
-
date.parse('Thu Mar 05 2020 10:42:29 GMT-0800', ' MMM D YYYY...');
85
-
86
-
// This plugin provides `dd`, `ddd` and `dddd` tokens for such a case. However they are not effective at all because day of week has not information to identify a date.
87
-
date.parse('Thu Mar 05 2020 10:42:29 GMT-0800', 'ddd MMM D YYYY...');
88
-
```
89
-
90
-
- (**Breaking Change**) The `subtract()` now returns a **REAL** number. Previously, it returned values with truncated decimals.
- Added `timespan` plugin. This plugin provides `timeSpan()` function to display a formatted elapsed time. This will might be integrated with the `subtract()`. See [PLUGINS.md](./PLUGINS.md) for details.
date.timeSpan(now, new_years_day).toHours('H [hours] m [minutes] s [seconds]'); // => '1537 hours 2 minutes 3 seconds'
107
-
```
108
-
109
-
- Added `microsecond` plugin for the parser. Microsecond is not supported by date objects so that it is rounded `millisecond` at the inside. See [PLUGINS.md](./PLUGINS.md) for details.
0 commit comments