Add custom date fields to tickets

Description

This plugin allows for validating custom fields as dates in tickets. Just set up the field as a custom field: http://trac.edgewall.org/wiki/TracTicketsCustomFields, then use these extra options in the trac.ini file:

fieldname.date = true
Enable extra date stuff on this field.
fieldname.date_empty = true
Allow this field to be blank.

Currently this will only validate that the given input looks like the specified date format (see below). Date range checking could be added if someone asks nicely enough.

The only configurable options are

format =
valid formats are dmy, mdy, and ymd
separator =
possible values are - or .
first_day =
let you change the first day of week (0=Sunday .. 6=Saturday) (as introduced in #1726)

Bugs/Feature Requests

Existing bugs and feature requests for DateFieldPlugin are here.

If you have any issues, create a new ticket.

Download

Download the zipped source from here.

Source

You can check out DateFieldPlugin from here using Subversion, or browse the source with Trac.

Example

To enable:

[components]
datefield.* = enabled

To configure:

[datefield]
format = ymd
separator = -
first_day = 1

Recent Changes

[3982] by doki_pen on 07/07/08 09:31:03

handle unknown date formats with the default value

[3978] by doki_pen on 07/06/08 22:15:42

  • changed template parameter map name to data for conventions sake
  • replaced ugly datefield.js addition to add_script invokation

[3977] by doki_pen on 07/06/08 16:37:46

added first_day parameter to fix ticket #1726

[3976] by doki_pen on 07/06/08 16:30:19

went back to old dateformat method to fix validation

Author/Contributors

Author: coderanger
Contributors: doki_pen

Attachments