wiki:DateFieldPlugin

Version 12 (modified by traemccombs, 5 years ago) (diff)

for people new to Trac, we really need to have the example: [ticket-custom] section.... otherwise, this whole bit is failure. To those who've been around a while, sure it makes sense. But those of use who are newbies.... I struggled with this too long. Please, if you change it, make sure you leave SOMETHING in the [ticket-custom] area. Thanks!

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 . 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 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

To configure:

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

Recent Changes

[12118] by rjollos on 2012-10-06 19:38:30
Highlight the current day, as requested by ynoslenav on the mailing list. The option does not seem to be effective on the 0.11 branch.
[11717] by rjollos on 2012-07-09 14:52:45
Refs #10107: Branching to support Trac 1.0. Bump DateFieldPlugin version to 3.0.0dev.
[11277] by rjollos on 2012-02-16 20:22:02
Refs 9825: Gif files were not being included in the egg.

Author/Contributors

Author: coderanger
Contributors: doki_pen

Attachments (4)

Download all attachments as: .zip