Strict Dates and ES Module Support
taylorhakes
released this
06 Jan 00:25
·
1 commit
to 4.0.0-beta.0-changes
since this release
Major Features and Breaking changes in this version
Improvements
- Valid date parsing - By default fecha will check validity of dates. Previously
2019-55-01
or2019-01-42
would parse correctly, since Javascript can handle it. Now invalid dates will returnnull
instead - ES Module and Tree Shaking Support - You can now import fecha
parse
orformat
independently
import {format, parse} from 'fecha';
format(...);
parse(...)
Breaking changes
parseDate
may returnnull
when previously returned aDate
. See improvements above, but invalid dates will returnnull
now- Change to how to set masks and i18n
Previously
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'
});