fecha v4.0.0 Release Notes

Release Date: 2020-01-17 // about 4 years ago
  • 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

    import {parse, format, setGlobalDateI18n, setGlobalDateMasks} from 'fecha';
    
    setGlobalDateI18n({
        // ...
    })
    setGlobalDateMasks({
      myMask: 'DD , MM, YYYY'
    });