Modify

Opened 7 weeks ago

Closed 7 weeks ago

Last modified 7 weeks ago

#11820 closed defect (fixed)

Cannot enter an acceptable date in Schedule Released field.

Reported by: roger.oberholtzer@… Owned by: rjollos
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 jun66j5 7 weeks ago.

Download all attachments as: .zip

Change History (8)

comment:1 Changed 7 weeks ago by jun66j5

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 7 weeks ago by rjollos

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 7 weeks ago by rjollos (previous) (diff)

Changed 7 weeks ago by jun66j5

comment:3 Changed 7 weeks ago by jun66j5

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

comment:4 Changed 7 weeks ago by rjollos

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

comment:5 Changed 7 weeks ago by jun66j5

  • Resolution set to fixed
  • Status changed from new to closed

In 13964:

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

comment:6 Changed 7 weeks ago by jun66j5

Thanks, Ryan! I just commited the patch.

comment:7 Changed 7 weeks ago by roger.oberholtzer@…

Works for me. Thanks!

Add Comment

Modify Ticket

Action
as closed .
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from rjollos. Next status will be 'closed'.
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.