Search and Top Navigation
#3642 closed bug (fixed)
Opened December 07, 2008 11:17PM UTC
Closed December 08, 2008 10:27AM UTC
Last modified October 11, 2012 09:15PM UTC
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: | ||
Blocked by: | Blocking: |
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.
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.