chrisdavies / tiny-date-picker

A small, modern, dependency-free date picker
https://chrisdavies.github.io/tiny-date-picker/
415 stars 87 forks source link

How can i change date format? #67

Closed notrealdev closed 6 years ago

notrealdev commented 6 years ago

Hi, by default date picker format d/m/y like 3/30/2018, how to change date format via option? I want change to Y/m/d?

chrisdavies commented 6 years ago

Check out the format/parse options in the docs here: https://github.com/chrisdavies/tiny-date-picker/blob/master/docs/tiny-date-picker.md

Basically, you can format it in any way you want, but you have to provide the complimentary parse function as well that turns it back into a date. When you write those functions, be sure to gracefully handle invalid values such as null, undefined, empty-strings, etc.