Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upDatePicker Format #2302
DatePicker Format #2302
Comments
|
There is no option to just set a format but you can introduce any display / parse format by implementing https://github.com/ng-bootstrap/ng-bootstrap/blob/master/src/datepicker/ngb-date-parser-formatter.ts#L9 |
|
ok, no offense but that seems rather complex for just wanting to have a display and value format ? Is there any example of using this ? Thank you |
That's the best we've got for now, I'm afraid. This is why I've marked this as a feature request. And just to be clear - it is not only about displaying a formatted date (which is trivial using built-in pipes) - it is also about parsing a date string as entered by a user (which is not trivial and this is why it is not implemented). We would highly appreciate people in the need of this feature to step in and write a general-purpose parser for dates entered by users! |
|
This is a disappointment that in 2019 anybody would accept the overly complicated solution to a seemingly trivial problem. For the past 12 years, many frameworks and libraries included an easy way of displaying dates and using all sorts of formats and masks. This team decided to rather implement NgbDateParserFormatter class than to simply provide a solution to formatting a string representing a date. This directive should come with "format" attribute taking a string for 3 or more basic date formats and move on. Please prioritize. |
I'm not a contributor myself but I think everybody is free to send a PR and propose improvements. That's the beauty of github open projects. |
|
Did a person who worked on this got a lottery or died so they cannot see these issues still being discussed? Last time anybody from contributors team looked at this issue was in 2018. They can give us some hints on where and how to fix this thing. |
|
I have multiple date pickers with multiple formats... This only works with 1 and only 1 format, or I have to create a factory for each and every format.. God I wish we would have picked anything other than bootstrap... |
I do not see an option in the datepicker for setting the display format ? It appears to only support yyyy-mm-dd , whereas I need to be able to set it to mm/dd/yyyy ?