Edgewall Software

Opened 10 years ago

Closed 10 years ago

Last modified 9 years ago

#11413 closed defect (fixed)

Difficult to edit directly text field with date/time picker — at Version 2

Reported by: Jun Omae Owned by:
Priority: normal Milestone: 1.0.2
Component: general Version: 1.0.1
Severity: normal Keywords: datepicker, jqueryui
Cc: Branch:
Release Notes:

Prevent moving the cursor to end of field with datetime picker when editing hours part

API Changes:
Internal Changes:

Description

The date/time picker on Trac has some issues. It is difficult to edit directly caused by the following issue.

  1. Restore immediately the value after removing end of the text field with backspace key
  2. Move the cursor to end of the text field after removing hours part
  3. Fill the text field with today after focusing even if it's empty

See https://groups.google.com/d/msg/trac-users/1Xi8cz-m1KY/7E8ZgU6WjKgJ.

Change History (2)

comment:1 by Jun Omae, 10 years ago

I've tried the latest of jquery-ui-addons.js, v1.4.3. But it isn't fixed.

I investigated it and noticed that timezone list must have default timezone even if the timezone is not used. The default timezone is at tags/trac-1.0.1/trac/htdocs/js/jquery-ui-i18n.js@:42#L28.

  • trac/web/chrome.py

    diff --git a/trac/web/chrome.py b/trac/web/chrome.py
    index 6e82b5d..a47d24e 100644
    a b class Chrome(Component):  
    11411141            'first_week_day': get_first_week_day_jquery_ui(req),
    11421142            'timepicker_separator': 'T' if is_iso8601 else ' ',
    11431143            'show_timezone': is_iso8601,
     1144            # default timezone must be included
    11441145            'timezone_list': get_timezone_list_jquery_ui() \
    1145                              if is_iso8601 else [],
     1146                             if is_iso8601 else ['Z'],
    11461147            'timezone_iso8601': is_iso8601,
    11471148        })
    11481149        add_script(req, 'common/js/jquery-ui-i18n.js')

The patch would fix the issues. However, even with the patch, the cursor is moved to end when invalid hours is typed.

comment:2 by Jun Omae, 10 years ago

Milestone: next-stable-1.0.x1.0.2
Release Notes: modified (diff)
Resolution: fixed
Status: newclosed

Committed with tests in [12370] and merged in [12371].

Note: See TracTickets for help on using tickets.