restorando / angular-pickadate

A simple and fluid inline datepicker for AngularJS with no extra dependencies.
MIT License
273 stars 91 forks source link

Configurable start of the week #5

Closed netsensei closed 10 years ago

netsensei commented 10 years ago

This calendar assumes a week starts on sunday. However, this is not an international consensus. In my region (Belgium) a calendarweek starts on a monday.

To change this, you need to make two changes directly in the code:

-              prevDates         = dateUtils.dateRange(-initialDate.getDay(), 0, initialDate),
-              currentMonthDates = dateUtils.dateRange(0, dayCount, initialDate),
+              prevDates         = dateUtils.dateRange(-initialDate.getDay() + 1, 1, initialDate),
+              currentMonthDates = dateUtils.dateRange(1, dayCount - 1, initialDate),

Not to mention: you need to set your $locale accordingly.

A bit tricky.

Is it possible to make this configurable?

peresola commented 10 years ago

Agreed! Anyway, thanks for the solution

gschammah commented 10 years ago

@netsensei @peresola thanks to @asharbitz we have this feature in master