Roundup Tracker - Issues

Message8289

Author rouilj
Recipients ThomasAH, ber, ngaba, rouilj, schlatterbeck, stefan, tobias-herp
Date 2025-01-18.17:25:15
Message-id <1737221115.83.0.0408241038286.issue2551390@roundup.psfhosted.org>
In-reply-to
I didn't get any feedback on the users list. So I decided to keep the status
quo if no changes are done by the admin making supporting this an optional
step during an upgrade.

Here is how it works:

 1) a simple field() or context/dateprop/field returns a month/day/year 
    selector. The new field_time() method includes hours and minutes. If
    the date-time value has non-zero seconds, seconds will also be shown.

 2) if format is supplied to the methods and isn't exactly: %Y-%m-%d 
    for field() or %Y-%m-%dT%H:%M:%S for field_time(), a text input using
    the supplied format will be produced and the calendar popup link 
    will be supplied -- fall back to 2.4 and earlier.
 
    A WARNING log message will be produced. Note that the default logging
    level is ERROR, so  it will not be seen without a change to the default.
    This log is not an ERROR level issue.
 
    The admin can set type="text" in the method call to suppress the warning.

 3) A 'datecopy.js' module (and minimized 'datecopy.min.js') is added to all
    templates. It includes an event handler that activates when any native date
    input receives a double-click. On double-click it changes the input to
    text input mode and selects the date. copy: ^C, paste: ^V, undo: ^Z and
    editing can be done in text mode.

    Hitting Enter/Return or moving to a new field by mouse or TAB will set the
    value and return to a native date input. Hitting Escape will reset the value
    to the original value and return to a date input.

    When the input is in text mode the class 'mode_textdate' is added to allow
    CSS to target it.


Currently there is no keyboard method to enter text mode. Only one handler is
added to the document and event delegation is used to activate it. This reduces
the memory footprint of the page and also allows it to work if a new date field
is added by javascript after the page loads. Double clicks are rare enough that
having the event handler activated every time isn't an issue. But activating it
on every keystroke to the page to detect a hotkey to move into text edit mode
seems excessive.

Support for tables/touch devices is more mixed. The native date input works
in chrome. Single tap activates the native date picker. It also supports
double-tap for double click and text input mode is activated. But in
firefox single press or an attempt to double press (click??) brings up
the native date editor. So there is no way to get into text input mode
that I can find in ff. I can't test with safari. Even so, the native date
picker should be an improvement.

changeset:   8285:2bf0c4e7795e
History
Date User Action Args
2025-01-18 17:25:15rouiljsetmessageid: <1737221115.83.0.0408241038286.issue2551390@roundup.psfhosted.org>
2025-01-18 17:25:15rouiljsetrecipients: + rouilj, schlatterbeck, stefan, ber, tobias-herp, ThomasAH, ngaba
2025-01-18 17:25:15rouiljlinkissue2551390 messages
2025-01-18 17:25:15rouiljcreate