Skip to content

Commit 6dab608

Browse files
committed
Updated README.md
1 parent 0bda3b4 commit 6dab608

File tree

1 file changed

+3
-55
lines changed

1 file changed

+3
-55
lines changed

README.md

Lines changed: 3 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ npm install date-and-time --save
3232

3333
## Recent Changes
3434

35+
- 0.14.2
36+
- Fixed regular expression denial of service (ReDoS) vulnerability.
37+
3538
- 0.14.1
3639
- Fixed a bug characters inside square brackets `[]` are not validated.
3740

@@ -53,61 +56,6 @@ npm install date-and-time --save
5356
date.format(today, 'M/D/YYYY'); // => '8/3/2020'
5457
```
5558

56-
- 0.13.0
57-
- The `format()` now supports a compiled formatString.
58-
59-
```javascript
60-
const pattern = date.compile('MMM D YYYY');
61-
62-
date.format(new Date(2020, 2, 3), pattern); // => Mar 3 2020
63-
date.format(new Date(2020, 3, 4), pattern); // => Apr 4 2020
64-
date.format(new Date(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.
91-
92-
```javascript
93-
const now = new Date(2020, 2, 5, 1, 2, 3, 4);
94-
const new_years_day = new Date(2020, 0, 1);
95-
96-
date.subtract(now, new_years_day).toDays(); // => 64.04309032407407
97-
```
98-
99-
- 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.
100-
101-
```javascript
102-
const now = new Date(2020, 2, 5, 1, 2, 3, 4);
103-
const new_years_day = new Date(2020, 0, 1);
104-
105-
date.timeSpan(now, new_years_day).toDays('D HH:mm:ss.SSS'); // => '64 01:02:03.004'
106-
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.
110-
11159
## Usage
11260

11361
- Node.js:

0 commit comments

Comments
 (0)