danielmoncada / date-time-picker

Angular Date Time Picker (Responsive Design)
https://daniel-projects.firebaseapp.com/owlng/date-time-picker
MIT License
137 stars 59 forks source link

Increased date time adapter compatibility #193

Open Venators opened 4 months ago

Venators commented 4 months ago

Thanks to the date-time picker's date implementation agnostic nature, it's easy for developers to work with their preferred date implementations. Out of the gate, they are treated to four pre-made modules: Native, Unix Timestamp, DayJs, and Moment.

However, all four of those date implementations use 0-indexed day of the week and month arrays, and subsequently, the date-time picker has hard-coded variables and 0-based logic that makes the library partially incompatible with date implementations that use different indexing, like Luxon, regardless of the custom date-time adapter in use.

The minor changes in this PR retain the current behaviour and compatibility with the current 0-indexed date implementations whilst also increasing the library's compatibility with 1-indexed date implementations.

danielmoncada commented 3 weeks ago

thank you @Venators , left a comment