Skip to content

v2.0.0

Choose a tag to compare

@tresko tresko released this 23 Aug 07:17
· 152 commits to master since this release

2.0.0 (2019-08-23)

Features

  • date-fns: we update date-fns to version v2.0.0 (38d961e), closes #4

BREAKING CHANGES

In version v2.0.0 we updated date-fns to 2.0.0. Therefore we need to make some breaking changes.

  • Date formatting All formats, Popular mistakes

      // Before v2.0.0.
      const dayLabelFormatFn = (date) => format(date, 'DD')
      const weekdayLabelFormatFn = (date) => format(date, 'dd')
      const monthLabelFormatFn = (date) => format(date, 'MMMM YYYY')
    
      useMonth({
        ...,
        dayLabelFormat = dayLabelFormatFn,
        weekdayLabelFormat = weekdayLabelFormatFn,
        monthLabelFormat = monthLabelFormatFn,
      })
    
      // v2.0.0.
      const dayLabelFormatFn = (date) => format(date, 'dd')
      const weekdayLabelFormatFn = (date) => format(date, 'eeeeee')
      const monthLabelFormatFn = (date) => format(date, 'MMMM yyyy')
    
      useMonth({
        ...,
        dayLabelFormat = dayLabelFormatFn,
        weekdayLabelFormat = weekdayLabelFormatFn,
        monthLabelFormat = monthLabelFormatFn,
      })
  • Hooks: parseDate function: The function takes an additional parameter, namely a date. Docs

    // Before v2.0.0
    parseDate('02/11/2014', 'MM/dd/yyyy')
    
    // v2.0.0
    parseDate('02/11/2014', 'MM/dd/yyyy', new Date())