[issue2551390] Replace text input/calendar popup with native date input
John Rouillard <[email protected]> Wed, 15 Jan 2025 01:19:13 +0000
| Newsgroups | gmane.comp.bug-tracking.roundup.devel |
|---|---|
| Message-ID | <[email protected]> |
New submission from John Rouillard: On issue2550858, I proposed replacing a text input and calendar popup for editing date/time fields with a native input of type date or datetime-local. This doesn't handle every use case, but I think it handles the majority of them and addresses all existing issues with the calendar popup. As part of this change, the field method for DateHTMLProperty class changes popcal=True to popcal=False by default. It adds a new: field_time() method for editing date and hours/minutes. Editing seconds only works if the seconds value is not 0. If you need to add seconds, use a text input (python:context.datefield.field(type="text", popcal=True)) to allow editing for the full date format and enable popcal. (See below for a double clicking action that helps this case.) The value returned by a datetime-local is set to an RFC3339 format date_time. The hyperdb Date class accepts input in the form YYYY-mm-DD.HH:MM:SS, but rfc3339 uses 'T' in place of '.'. So hyperdb Date will parse rfc3339 as well. The field() and field_time() methods force the proper format when date or datetime-local type is used. Trying to specify a format will result in an exception. I also created a javascript file on Thomas's suggestion we support copy/paste. Including this file (see msg8268) allows copying of date/datetime-local by double clicking on the input. This changes it to a text input that allows copying or pasting. Note that this can also allow raw editing of the date/time for editing/adding seconds. One thing to note is that the value shown is in RFC3339 format not roundup full date format. Using the native date/time should be an improvement for tablet users as well. Note that double-click may not work on touch devices. This change hides issues with backend the date interval calculations from the front end, but we still need to handle the backend issues on another ticket. Anybody want to try the patches? See also: issue2551260, issue2550935, issue2550527, issue2551124 ---------- assignee: rouilj components: Web interface messages: 8269 nosy: ThomasAH, ber, ngaba, rouilj, schlatterbeck, stefan, tobias-herp severity: normal status: new title: Replace text input/calendar popup with native date input type: behavior _________________________________________________ Roundup tracker <[email protected]> <https://issues.roundup-tracker.org/issue2551390> _________________________________________________