kendo-react icon indicating copy to clipboard operation
kendo-react copied to clipboard

[Bug][DatePicker and DateRangePicker] Today button does not update the input when format is set

Open WissamProgress opened this issue 2 years ago • 1 comments

I'm submitting a...

  • Bug report

Current behavior

When setting the format prop such that the format do not include the year value, pressing the Today button does not update the input element with today's date. Nevertheless, the correct value is set to the component and the correct date is received in the onChange event handler.

Expected behavior

Pressing the Today button updates the input element with the correct date.

Minimal reproduction of the problem with instructions

set the date to "MM-dd" https://stackblitz.com/edit/react-hxv8oe-7kb1pb?file=app%2Fmain.tsx

Workarounds

Handle the component in controlled mode, and set initial values https://stackblitz.com/edit/react-hxv8oe-ivygic?file=app%2Fmain.tsx

Include the year in the format https://stackblitz.com/edit/react-hxv8oe-ayutvq?file=app%2Fmain.tsx

Ticket ID: 1636933

WissamProgress avatar Jan 15 '24 15:01 WissamProgress

This bug is not reproducible with the same example included in the description even when not changing the versions and dependencies. Therefore, the issue might be specific to today's date.

WissamProgress avatar Feb 16 '24 13:02 WissamProgress