jquery-ui icon indicating copy to clipboard operation
jquery-ui copied to clipboard

Datepicker: beforeShowDay is passed wrong date when dayNamesShort are used

Open pramodjodhani opened this issue 4 years ago • 1 comments

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.

pramodjodhani avatar Aug 31 '21 07:08 pramodjodhani