On Saturday, February 1, 2014 9:35:55 AM UTC-8, RjOllos wrote:
>
> On Saturday, February 1, 2014 3:49:17 AM UTC-5, hasienda wrote:
>>
>> -----BEGIN PGP SIGNED MESSAGE----- 
>> Hash: SHA1 
>>
>> On 01.02.2014 00:02, RjOllos wrote: 
>> > The datetime field enhancements on the current trunk may provide better 
>> > support than DateFieldPlugin. 
>>
>> +1 This is the way to go for a new install or on, that one expects to 
>> stay in use for longer and or for production. 
>>
>> While the plugin operated on strings the upstream implementation since 
>> 1.1.1 adds true date/time field support including date picker and time 
>> zone correct time stamps, search ('-1w' due within last week) and future 
>> search expressions ('+5d' due within next five days). 
>>
>> Steffen Hoffmann 
>>
>
> Here's a single file plugin that implements the feature (1). It's a little 
> hackish, but the best I could come up with. Maybe someone will show a 
> better way :)
>
> It needs more testing. Please report back if you spot any issues. It was 
> developed against Trac 1.1.2dev-r12471. I'm pretty sure you'll need to be 
> running at least Trac 1.1.2dev-r12373 for it to work. If we didn't use the 
> trac-datetimepicker class (2), the restriction could probably be relaxed to 
> Trac 1.1.1.
>
> (1) https://gist.github.com/rjollos/8755497
> (2) http://trac.edgewall.org/changeset/12373
>

There was a minor bug in the plugin that was fixed this evening.

Note that the //Created// field will only appear for users with the 
TRAC_ADMIN permission, but you can easily adjust this behavior if you'd 
like.

In case anyone is interested in the implementation, the slightly more 
complex parts were due to:
 * I couldn't figure out how to determine in `post_process_request` that a 
new ticket was being created (i.e. the request was a POST from /newticket 
that redirected to /ticket/id). Therefore, had to set the custom field to 
None as an conditional. If there was a straightforward way to determine 
while in `post_process_request` that a new ticket was being created, then 
the actual ticket creation date could be store in the custom field.
 * Implementing ITemplateStreamFilter wouldn't be necessary if you were 
okay with having the custom field in the typical location, but it seemed 
more intuitive to locate it at the top of the form.

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To post to this group, send email to trac-users@googlegroups.com.
Visit this group at http://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to