kekeh / angular-mydatepicker

Angular datepicker and date range picker :date:
https://kekeh.github.io/angular-mydatepicker/
MIT License
1 stars 11 forks source link

Date format is invalid #12

Open randym127 opened 5 years ago

randym127 commented 5 years ago

m = minutes in most apis. I am having issues because I have some parts of my system needed dd-MMM-yyyy, and in this datepicker I have a completely different date format.

I can't use this component I think, I would suggest you use a standard format like in SimpleDateFormat

The component breaks with dd-MMM-yyyy

kekeh commented 5 years ago

It is possible set value of date format option also dynamically so you can MMM => mmm

Probably this case is easy to solve. Can explain or share a code snippet what you are trying?

randym127 commented 5 years ago

Very easy to solve for sure by changing the date format I have configured into all lowercase. Just the component doesn't play nice with other parts of the system, in all parts of the system I use dd-MMM-yyyy, but when I get to this component I have to lowercase it which then breaks things in other places. Or I have to send two date formats to my client side, one for Angular and one for this component. Might want to consider using a more standard date format in future releases.

randym127 commented 5 years ago

Another issue is displaying full months, that does not work as I would expect as well.

MMMM dd, yyyy should display as August 13, 2019. When I pass mmmm dd, yyyy. it displays as Augm 13, 2019.

kekeh commented 5 years ago

You can check from here: https://github.com/kekeh/angular-mydatepicker#options-attribute how to

options work. If you put mmm to date format then month name is shown. Default month value is short month name. If you want long month name you have to set them with the monthLabels option.