terra-framework icon indicating copy to clipboard operation
terra-framework copied to clipboard

[terra-date-time-picker] DST missing hour keyboard shortcut improvement

Open neilpfeiffer opened this issue 3 years ago • 1 comments

Bug Report

Description

PR #1520 [terra-date-time-picker] Add support for date-picker and time-input keyboard shortcuts -- when completed contained a bug in the handling of keyboard shortcuts when incrementing/decrementing days if the time was set between 02:00 and 03:00 (AM) and the user moved the date over the start day of DST when there is a missing hour.

Link to the originating comment detailing the problem: ../terra-framework/pull/1520#pullrequestreview-923848063

Steps to Reproduce

For Daylight Savings handling when DST begins, the keyboard shortcuts for + & - are performing as expected when focus is in the time input, correctly skipping the missing hour when incrementing and decrementing time (01:59++=03:00, 03:00+-=01:59), but when focus is in the date input, the time is not being handled correctly.

The current behavior when the date is any day before or after when DST begins, (e.g. March 06, 2020) and the time is between 02:00 and 03:00, valid on March 6th (e.g. 03/06/2020 02:30), with focus in the date input, pressing + these number counts, changes the value to:

  1. 03/07/2020 02:30 (correct)
  2. 03/08/2020 03:30 (correct)
  3. 03/09/2020 03:30 (incorrect)
  4. 03/10/2020 03:30 (incorrect)

And same is true in reverse starting with 03/12/2020 02:30 with pressing -, the time is correct on 03/08/2020 at 03:30, but should go back to 02:30 starting on 03/07/2020:

incorrect-DST-start-missing-hour-and-hotkeys-PR#1520


Expected Behavior

The correct expected behavior is when starting with the time between 02:00 and 03:00 on the days before/after the start of DST (e.g. 03/06/2020 02:30), for time to shift up an hour on the day of the start of DST when the missing hour occurs, but then go back to the original time for days before or after when the missing hour does not occur. Using the same example above when pressing + these number counts, the correct values would be:

  1. 03/07/2020 02:30 (correct)
  2. 03/08/2020 03:30 (correct)
  3. 03/09/2020 02:30 (correct)
  4. 03/10/2020 02:30 (correct)
  5. 03/11/2020 02:30 (correct)

neilpfeiffer avatar Mar 29 '22 14:03 neilpfeiffer

UXPLATFORM-6643 logged to track internally.

chrismichalewicz avatar Jun 01 '22 15:06 chrismichalewicz