Modify

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#11820 closed defect (fixed)

Cannot enter an acceptable date in Schedule Released field.

Reported by: roger.oberholtzer@… Owned by: Ryan J Ollos
Priority: normal Component: ExtendedVersionPlugin
Severity: normal Keywords:
Cc: Trac Release: 1.0

Description

I just installed this plugin on my system.

When I try to enter a date in the Schedule Released field, I get a pop-up calendar. Unfortunately, that provides a date as:

Jun 16, 2014 3:52:37 PM

while the plugin seems to want MM/DD/YY hh:mm:ss

I cannot seem to override the popup calendar. As soon as I type anything in the field, the popup is shown. It changes the field to the wrong format.

Attachments (1)

extendedversionplugin-r13963.diff (1.7 KB) - added by Jun Omae 11 years ago.

Download all attachments as: .zip

Change History (8)

comment:1 Changed 11 years ago by Jun Omae

Reproduced. The issue is caused by wrong use of parse_date in the plugin. Could you please try the following patch?

  • extendedversion/version.py

     
    2727    ITicketGroupStatsProvider, apply_ticket_permissions,
    2828    get_ticket_stats, get_tickets_for_milestone
    2929)
    30 from trac.util.datefmt import get_datetime_format_hint, parse_date, utc
     30from trac.util.datefmt import (
     31    get_datetime_format_hint, parse_date, user_time, utc
     32)
    3133from trac.util.translation import _
    3234from trac.web.chrome import (
    3335    Chrome, INavigationContributor, IRequestHandler, ITemplateProvider,
     
    270272
    271273        # -- check completed date
    272274        if 'time' in req.args:
    273             time = time and parse_date(time, req.tz) or None
     275            time = user_time(req, parse_date, time, hint='datetime') \
     276                   if time else None
    274277        else:
    275278            time = None
    276279        version.time = time

comment:2 Changed 11 years ago by Ryan J Ollos

The usage of parse_date appears to be correct for Trac 0.12, it just doesn't consider the locale, which is needed in Trac 1.0. I suppose we can copy the user_time function to extendedversion.compat.

Last edited 11 years ago by Ryan J Ollos (previous) (diff)

Changed 11 years ago by Jun Omae

comment:3 Changed 11 years ago by Jun Omae

Indeed. Revised the patch, extendedversionplugin-r13963.diff.

comment:4 Changed 11 years ago by Ryan J Ollos

Patch looks good to me. As always, feel free to commit it.

comment:5 Changed 11 years ago by Jun Omae

Resolution: fixed
Status: newclosed

In 13964:

Fixed Edit Version page not working for i18n date/time string with Trac 1.0.x (closes #11820)

comment:6 Changed 11 years ago by Jun Omae

Thanks, Ryan! I just commited the patch.

comment:7 Changed 11 years ago by roger.oberholtzer@…

Works for me. Thanks!

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.