Skip to content

Datepicker: beforeShowDay is passed wrong date when dayNamesShort are used  #1971

Open
@pramodjodhani

Description

@pramodjodhani

Please see the demo of the issue here: https://jsfiddle.net/ea8utdyx/

Here are the steps to reproduce the problem:

  1. Use a nonstandard date format, like 'D M d yy'
  2. Pass dayNamesShort, example: dayNamesShort: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
  3. Pass a callback function to beforeShowDay argument

Notice that the date which is passed to the beforeShowDay callback is incorrect, it's about 6 years in the future. As a result, we cannot determine if a date should be visible or not.

In the demo, I have added console.log, which in the callback, you can check that it doesn't log the correct date.

image

I notice the problem doesn't happen when we comment the dayNamesShort argument.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions