Avaiga / taipy

Turns Data and AI algorithms into production-ready web applications in no time.
https://www.taipy.io
Apache License 2.0
9.73k stars 690 forks source link

BUG-Date control time jumps forward with DST #563

Open arcanaxion opened 10 months ago

arcanaxion commented 10 months ago

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,

  1. Click on the date control
  2. 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
  3. 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
  4. 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 date-control-dst-issue

Runtime environment

FlorianJacta commented 6 months ago

A client reported this issue again. It seems tricky to handle.

github-actions[bot] commented 1 month ago

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.