Roundup Tracker - Issues

Message8280

Author rouilj
Recipients ThomasAH, ber, ngaba, rouilj, schlatterbeck, stefan, tobias-herp
Date 2025-01-15.20:55:23
Message-id <1736974523.93.0.337964553052.issue2551390@roundup.psfhosted.org>
In-reply-to
I have been working through the changes and docs.

The biggest hangup is handling format strings for the dates.
For example:  in German, "%d-%m-%Y" is common, for the US: "%m-%d-%Y"
is common.

After this change, when using the native date input, the format must be
"%Y-%m-%d" so that the native date input can parse/display it. Currently
the code throws an exception if format is set and does not exactly match
the required format.

Similar rules apply for datetime-local inputs.

I am considering just ignoring format if the input type is a
native date/datetime-local.

Alternatvely, ignore the date if it looks compatible. For example: "%m,%d|%Y"
is compatible with a date input. I can do this with )use set to get rid of ordering
issues):

  set(re.findall('%([A-z])', format)) == set("Y", "m", "d")

to consider the format compatible with 'date' and

   set(r.findall(...)) in [set(['Y', 'm', 'd', "H", "M"]),
                           set(['Y', 'm', 'd', "H", "M", "S"])]

to consider it compatible with datetime-local. A year/month format like: "%m-%Y" would
not be compatible and would throw an exception. (Yes weird formats like:
"%Y: %m %m-%d will be incorrectly accepted but ... they deserve it 8-).)

I don't like spending cpu cycles doing the compatibility test, but...

Thoughts?
History
Date User Action Args
2025-01-15 20:55:23rouiljsetmessageid: <1736974523.93.0.337964553052.issue2551390@roundup.psfhosted.org>
2025-01-15 20:55:23rouiljsetrecipients: + rouilj, schlatterbeck, stefan, ber, tobias-herp, ThomasAH, ngaba
2025-01-15 20:55:23rouiljlinkissue2551390 messages
2025-01-15 20:55:23rouiljcreate