68 lines
1.9 KiB
Markdown
68 lines
1.9 KiB
Markdown
### 4.2.0
|
|
Added isoDate and isoDateTime masks
|
|
|
|
### 4.1.0
|
|
Added Z format/parse and fixed Peru timezone issue
|
|
- Added `Z` format token. See readme for more info. Big thanks to @fer22f for writing the code.
|
|
- Fixed a strange issue when Peru changed timezones in 1990. See #78
|
|
|
|
## 4.0.0
|
|
**Major Features and Breaking changes in this version**
|
|
|
|
#### Improvements
|
|
- *Valid date parsing* - By default fecha will check validity of dates. Previously `2019-55-01` or `2019-01-42` would parse correctly, since Javascript can handle it. Now invalid dates will return `null` instead
|
|
- *ES Module and Tree Shaking Support* - You can now import fecha `parse` or `format` independently
|
|
```js
|
|
import {format, parse} from 'fecha';
|
|
|
|
format(...);
|
|
parse(...)
|
|
```
|
|
|
|
#### Breaking changes
|
|
- `parseDate` may return `null` when previously returned a `Date`. See improvements above, but invalid dates will return `null` now
|
|
- Change to how to set masks and i18n
|
|
Previously
|
|
```js
|
|
import fecha from 'fecha';
|
|
|
|
fecha.i18n = { ... }
|
|
fecha.masks.myMask = 'DD , MM, YYYY'
|
|
```
|
|
|
|
New
|
|
```js
|
|
import {parse, format, setGlobalDateI18n, setGlobalDateMasks} from 'fecha';
|
|
|
|
setGlobalDateI18n({
|
|
// ...
|
|
})
|
|
setGlobalDateMasks({
|
|
myMask: 'DD , MM, YYYY'
|
|
});
|
|
```
|
|
|
|
### 3.0.3
|
|
- Fixed bug when using brackets when parsing dates
|
|
### 3.0.2
|
|
- Fixed issue where src files are not included correctly in npm
|
|
|
|
### 3.0.0
|
|
- Moved to ES modules
|
|
- Changed invalid date from `false` to `null`
|
|
|
|
### 2.3.3
|
|
Fixed bug with year 999 not having leading zero
|
|
|
|
### 2.3.2
|
|
Added typescript definitions to NPM
|
|
|
|
### 2.3.0
|
|
Added strict version of date parser that returns null on invalid dates (may use strict version in v3)
|
|
|
|
### 2.2.0
|
|
Fixed a bug when parsing Do format dates
|
|
|
|
## 2.0.0
|
|
Fecha now throws errors on invalid dates in `fecha.format` and is stricter about what dates it accepts. Dates must pass `Object.prototype.toString.call(dateObj) !== '[object Date]'`.
|