coachcare / npm-datepicker

Material Datepicker Fork with TimePicker by CoachCare
MIT License
32 stars 18 forks source link

[major] Picker 'almost' always picks 'pm' values instead of 'am' #17

Open Enngage opened 6 years ago

Enngage commented 6 years ago

Hi, this is quite a major issue as in my culture with 24 hour format ('cs' - though it likely behaves like this in all of them) the picker almost always picks 'pm' value (i.e. 3pm) instead of 'am' (i.e. 3am) even though I'm clicking on 'am' values. See example:

incorrect_date

In the first case, I'm selecting '2' and in properly selects '2' am. However, if I go back to hour selection and select '3' it selects '3' pm instead of am. Subsequent cases behave the same.

This is a major showstopper, could you please look into this?

adelchi commented 6 years ago

tried to fix it, its not well tested though https://github.com/adelchi/npm-datepicker/commit/0f6e73ab2d5b9035869e31c14fc87d2320ffaf78

Askiater commented 5 years ago

@Enngage a little off-topic, but how you change month and year to a different language? (For Cancel and Ok button I guess you just change datepicker-intl.ts, but how did you do that for month and year?)

Enngage commented 5 years ago

@Askiater, if I remember correctly this is because I was using moment adapter for Angular material and using it with this datepicker as well. Since then I've however switched to Luxon because the size impact of Moment and its locales (it adds more then 1MB to your Angular bundle size - and that is compiled). I advice you do the same as soon as you can and run away from Moment. This library, as far as I know, does not support changing date adapter so you would have to look elsewhere.

Askiater commented 5 years ago

@Enngage, thank you for your advice. Right now I (for test) delete moment from dependencies and bundle size decreased for ~0.8MB. That's kinda shocked me. In the next project, I definitely try to use something else, but for now, I need something compatible with Material Design (in design style) and Angular with customizable language support =/

makkaronis4e commented 5 years ago

Is here any chance, that this critical bug will be fixed? Or this library abandoned?

Enngage commented 5 years ago

Seems like it. I recommend using https://github.com/Agranom/ngx-material-timepicker