litepie-datepicker
litepie-datepicker copied to clipboard
Start week on Monday
Is there a way to have Mondays appear first in the datepicker, instead of Sundays?
If not, please consider this a feature request.
I can add new props
for next release.
thank you
Hi there, it would be great, to set the first day of the week.
This looks like a really promising tool - great work so far. But I also am dearly missing the option to start the week on monday. Maybe an option to manually change the underlying day.js configuration would be a solution?
Great component, but I am also dearly missing the feature to set the start of the week. This puts off more than half the world. https://en.wikipedia.org/wiki/Week#Other_week_numbering_systems
It is actually provided by dayjs.localeData().firstDayOfWeek() must be either 6, 0 or 1. (Sa, Su, Mo) So, I couldn't find it yet, but all we have to do is, to offset the weekday header and the day table generation. Shouldn't be too difficult. Any ideas?
right now dayjs().date() is used (datepicker.previous) if we switch it to a range base on:
// example september and first weekday: monday
dayjs.locale('de')
const sep = dayjs('2022-09-01')
const firstDayOfMonth = sep.date(1) // Sep 1st Thursday
const firstDayOfMonthWeek = firstDayOfMonth.startOf('week') // August 29th Monday
const lastDayOfMonth = sep.endOf('month') // Sep 30th Friday
const lastDayOfMonthWeek = lastDayOfMonth.endOf('week') // October 2nd Sunday