lugolabs / tutorials

Tutorial demos for https://www.lugolabs.com
MIT License
31 stars 65 forks source link

Startday of week #9

Closed fruor closed 7 years ago

fruor commented 7 years ago

The first day of the week can be changed to monday in the creator by $('#weekpicker').weekpicker({ firstDay: 1, (...)

Now the grid adapts, but the selected week doesn't adapt - it will always select the first sunday.

I solved it in my local copy by adding to the _create function: if(typeof(this.options.firstDay) == 'undefined') { this.options.firstDay = 0; }

then you can safely change the last lines in _setWeek function to: this._startDate = new Date(year, month, day + this.options.firstDay); this._endDate = new Date(year, month, day + this.options.firstDay + 6);