Strict Dates and ES Module Support
·
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-01or2019-01-42would parse correctly, since Javascript can handle it. Now invalid dates will returnnullinstead - ES Module and Tree Shaking Support - You can now import fecha
parseorformatindependently
import {format, parse} from 'fecha';
format(...);
parse(...)Breaking changes
parseDatemay returnnullwhen previously returned aDate. See improvements above, but invalid dates will returnnullnow- 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'
});