lumapps / lumX

The first responsive front-end framework based on Angular & Google Material Design specifications
https://ui.lumapps.com
MIT License
1.96k stars 274 forks source link

Date Picker without november 2020 days #610

Open Gesley opened 5 years ago

Gesley commented 5 years ago

when i try to select a day in november of a 2020 there are no one days to select. error

fabianocruzdf commented 5 years ago

There's an issue with moment .endOf('month'). Just replace:

var lastDayOfMonth = firstDayOfMonth.clone().endOf('month'); to var lastDayOfMonth = firstDayOfMonth.clone().add(1, 'months').subtract('days', 1); in generateCalendar().

Here works like a charm. I think there's a better solution, but for now this it's enough.

Gesley commented 5 years ago

Like a charm, ok. Live the diversity

thanks

arnaudvalle commented 5 years ago

Hello there, thanks for reporting this. Fabiano's trick works well as a temporary workaround but it seems like this is actually an issue to do with the moment library (see https://github.com/moment/moment/issues/4727).

They have a PR awaiting merge so it shouldn't be too long before this gets sorted.

Many thanks,