Skip to content

Not sure how getDateStr prop is supposed to work. #269

@jmaylin

Description

@jmaylin

Here is what the documentation says about getDateStr:

A function to override how to format the date into a String for display, receives a Date instance

Can someone explain me the following behavior?

This works:

<DatePicker
  ...
  format="LL"
/>

This doesn't work (isn't getDateStr supposed to replace format?):

<DatePicker
  ...
  getDateStr={rawDate => moment(rawDate).format('LL')}
/>

This works (and I can save rawDate for something else):

<DatePicker
  ...
  format="LL"
  getDateStr={rawDate => moment(rawDate).format('LL')}
/>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions