Ticket #3642 (closed bug: fixed)
firstDay displays Day names incorrectly in multi-month view
| Reported by: | ruler | Owned by: | |
|---|---|---|---|
| Priority: | minor | Milestone: | |
| Component: | ui.datepicker | Version: | 1.6rc2 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
A picture is worth a thousand words:
http://test.static.marketruler.com/test/datepicker-fdow.php
Note the days of the week are:
We Sa Tu Fr Mo Th Su
firstDay is "3"
Haven't figured out the fix yet, but should be easy, I assume.
Change History
Note: See
TracTickets for help on using
tickets.


This issue occurs when firstDay is passed as a string. Since I pass things from PHP using json_encode, this may happen more often than not. (Need to double-check this in PHP, although no matter)
The fix is to change line 1399 of ui.datepicker.js 1.6rc2 from:
var firstDay = this._get(inst, 'firstDay');
to
var firstDay = parseInt(this._get(inst, 'firstDay'));
Reason is:
("3" + 1) % 7 = ("31" % 6) = wrong answer
Operator overloading is nice... sometimes.