taipy
taipy copied to clipboard
BUG-Date control time jumps forward with DST
Description The time portion of the date control behaves strangely when attempting to select a time after clocks shift with DST.
Specifically, when selecting a time after the clock moves forward (an hour) with DST, the control automatically modifies my selection by +1 hour.
How to reproduce
from taipy.gui import Gui, Markdown
import datetime as dt
from dateutil.tz import tzlocal, tzutc, gettz
tz_name = "Australia/Melbourne"
selected_datetime = dt.datetime(2023, 8, 11, tzinfo=gettz(tz_name)).astimezone(tzutc())
md = Markdown(
"""
## selected_datetime:
<|{selected_datetime}|date|with_time|> <|{repr(selected_datetime)}|>
""")
Gui(md).run(time_zone=tz_name)
Then,
- Click on the date control
- Select a date and time after 1 October 2023 2:00 AM a. The taipy app time_zone is set to Melbourne, which turns their clock forward at 2023-10-01T02:00:00 to 2023-10-01T03:00:00
- Observe that clicking some hour would instead result in the selected hour being incremented by 1 a. E.g. clicking the hour 04 would instead select 05
- Furthermore, changing the minutes would also increment the hour by 1
Also
Expected behavior No automatic incrementing should happen and possibly also 0200 <= time < 0300 (which doesn't exist on 2023-10-01 in Melbourne) should not be selectable.
Screenshots
Runtime environment
- OS: WSL
- Chrome on Windows - Version 116.0.5845.97 (Official Build) (64-bit)
A client reported this issue again. It seems tricky to handle.
This issue has been labelled as "🥶Waiting for contributor" because it has been inactive for more than 14 days. If you would like to continue working on this issue, please add another comment or create a PR that links to this issue. If a PR has already been created which refers to this issue, then you should explicitly mention this issue in the relevant PR. Otherwise, you will be unassigned in 14 days. For more information please refer to the contributing guidelines.