Ticket #3642 (closed bug: fixed)

Opened 6 years ago

Last modified 22 months ago

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

comment:1 Changed 6 years ago by ruler

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.

comment:2 Changed 6 years ago by kbwood

  • Status changed from new to closed
  • Resolution set to fixed

Fixed.

comment:3 Changed 22 months ago by scott.gonzalez

  • Milestone TBD deleted

Milestone TBD deleted

Note: See TracTickets for help on using tickets.