Skip to content

Latest commit

 

History

History
59 lines (45 loc) · 1.59 KB

CHANGELOG.md

File metadata and controls

59 lines (45 loc) · 1.59 KB

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
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

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]'.