|Version 24 (modified by rjollos, 5 years ago) (diff)|
Add custom date fields to tickets
This plugin allows for validating custom fields as dates in tickets. Just set up the field as a custom field, 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 configurable options are:
- format =
- valid formats are dmy, mdy, and ymd
- separator =
- possible values are - or . or /
- first_day =
- let you change the first day of week (0=Sunday .. 6=Saturday) (as introduced in #1726)
The following options are available since 
- months = 1
- How many months to show at once?
- milestone = false
- Use datepicker for milestone due/complete? (format= must match your locale)
- weeknumbers = false
- Show ISO8601 week numbers?
- panel = false
- Show a button panel with "Today" and "Done" buttons (at bottom)?
- change_month = false
- Show a dropdown with month selection?
- change_year = false
- Show a dropdown with year selection?
- match_request =
- Use datepicker on arbitrary request paths. Use text fields with class=datepick in your template, and configure the start of request path (in list format), like: match_request = /query,/other_path
There are many other options, but you need to modify the datefield.html template if you want to use them. See http://docs.jquery.com/UI/Datepicker
If you have any issues, create a new ticket.
Download the zipped source from here.
[components] datefield.* = enabled
To add a Due Date:
[ticket-custom] due_date = text due_date.date = true due_date.label = Due Date due_date.value = MM-DD-YYYY due_date.date_empty = true
[datefield] format = mdy separator = - first_day = 1
-  by rjollos on 2014-12-15 06:03:26
2.0.0dev: Restore line accidentally deleted in . Refs #12035.
-  by rjollos on 2014-12-15 05:59:07
2.0.0dev: Use 2-digit year format for compatibility with milestone date field. Fixes #12035.
-  by rjollos on 2014-12-15 01:20:10
3.0.0dev: Replace the special value <now> in the value field with the current date. Fixes #12049.
(720 bytes) -
added by bigjonroberts 7 years ago.
Example of using date field in a report.
- customfields.jpg (6.2 KB) - added by doki_pen 6 years ago.
(13.0 KB) -
added by rjollos 3 years ago.
DateFieldPlugin at version 1.0.3
- DatePickerTrac011.png (14.7 KB) - added by rjollos 3 years ago.
Download all attachments as: .zip