Edgewall Software
Modify

Opened 9 years ago

Closed 9 years ago

#12344 closed defect (fixed)

Datetime picker is not available for time field with relative format

Reported by: Jun Omae Owned by: Jun Omae
Priority: normal Milestone: 1.2
Component: ticket system Version:
Severity: normal Keywords: datepicker
Cc: Branch:
Release Notes:

Fix not working datetime picker for time field with relative format.

API Changes:
Internal Changes:

Description

Cause trac-relativepicker class is used.

<input type="text" id="field-verified_at" title="y/MM/dd H:mm:ss" name="field_verified_at"
       value="2016/01/01 9:00:00"
       class="trac-relativepicker" />

Attachments (0)

Change History (4)

comment:1 by Ryan J Ollos, 9 years ago

Prior to [12373], the class would have been relativepicker. I guess issue might be due to original implementation in [11333] though.

comment:2 by Jun Omae, 9 years ago

Owner: set to Jun Omae
Status: newassigned

Thanks. I think we should use trac-datetimepicker for relative time fields.

  • trac/ticket/templates/ticket.html

    diff --git a/trac/ticket/templates/ticket.html b/trac/ticket/templates/ticket.html
    index ec84ccae2..831012787 100644
    a b ${value}</textarea>  
    272272                                 checked="${value == option or None}" />
    273273                          ${option}
    274274                        </label>
    275                         <input py:when="'time'" type="text" id="field-${field.name}" title="${field.format_hint}"
    276                                name="field_${field.name}" value="${field.edit}" class="trac-${field.format}picker" />
     275                        <input py:when="'time'"
     276                               type="text" id="field-${field.name}" title="${field.format_hint}"
     277                               name="field_${field.name}" value="${field.edit}"
     278                               class="trac-${'date' if field.format == 'date' else 'datetime'}picker" />
    277279                        <py:otherwise><!--! Text input fields -->
    278280                          <py:choose>
    279281                            <!--! Special case for Cc: field -->

comment:3 by Ryan J Ollos, 9 years ago

Using trac-datetimepicker seems like a good choice, and works well.

comment:4 by Jun Omae, 9 years ago

Release Notes: modified (diff)
Resolution: fixed
Status: assignedclosed

Thanks for the review! Committed in [14534].

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jun Omae.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Jun Omae to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.