jquery / jquery/jquery-ui

Datepicker: beforeShowDay is passed wrong date when dayNamesShort are used

Open
#2,355 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Behavior shared with 1.12 Comp: Datepicker
Dominant language
JavaScript
Stars
11.3k
Forks
5.2k
PR merge metrics
No merged PRs in 30d

Description

👋

I had raised a similar issue previously #1971, which was for "D M d yy" format. I have found that the same problem happens with dd. MM yy format too.

Please check this minimal example to recreate the problem.: https://jsfiddle.net/smnt1o5r/2/

Please note that the dates passed to the callback function are of 2031, which is very random

Image

I also noticed that this time the problem is not dependent on dayNamesShort

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the minimal jsFiddle reproduction linked in the issue and inspect the datepicker path that invokes the beforeShowDay callback. Reproduce the issue with the dd. MM yy format and compare the dates received by the callback with the displayed dates. Done means the callback receives the correct dates for this format and the existing example no longer reports dates from 2031.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, jquery
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.