Skip to content
This repository has been archived by the owner on Oct 27, 2022. It is now read-only.

DatePicker interface #34

Open
alexbeletsky opened this issue Jul 26, 2016 · 3 comments
Open

DatePicker interface #34

alexbeletsky opened this issue Jul 26, 2016 · 3 comments

Comments

@alexbeletsky
Copy link

I do not understand why date picker takes value and defaultValue as strings, but onChange method outputs moment object.

Also, we need to format value and defaultValue with a pattern and when submit this pattern to control itself.

<DatePicker value={moment(value).format('DD/MM/YYYY')} pattern={'DD/MM/YYYY'} />

Internally it's transformed to moment, which again forces me to ask - why not just taking a moment in a first place?

  • value - moment object
  • pattern - data format pattern used to render date in input control
  • onChange(date) - returns moment object
@alexkuz
Copy link
Owner

alexkuz commented Jul 26, 2016

Yes, it makes sense. Can you make a PR?

@alexbeletsky
Copy link
Author

I will try to.

@alexbeletsky
Copy link
Author

Tried that quickly, but I introduced regression issues with masked input. Will likely give it another spin later.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants