Changes between Version 37 and Version 38 of DateFieldPlugin


Ignore:
Timestamp:
Jan 21, 2012, 2:43:30 AM (12 years ago)
Author:
Adrian Fritz
Comment:

Page re-factor. Retrieves code documentation (as in [11026]). Still requires some review.

Legend:

Unmodified
Added
Removed
Modified
  • DateFieldPlugin

    v37 v38  
    11[[PageOutline(2-5,Contents,pullout)]]
    2 = Add custom date fields to tickets =
     2= Add custom date fields to tickets and helps date selection =
    33
    44== Description ==
    55
    6 This plugin allows for validating custom fields as dates in tickets. Just set up the field as a [http://trac.edgewall.org/wiki/TracTicketsCustomFields custom field], then use these extra options in the trac.ini file:
    7  ''fieldname''.date = true::
    8    Enable extra date stuff on this field.
    9  ''fieldname''.date_empty = true::
    10    Allow this field to be blank.(default value "due_date.value" must be empty)
    11 or use the CustomFieldAdminPlugin to create a date field:
     6This plugin allows for validating custom fields as dates in tickets and also for milestones `due_date` field (some restriction apply).
     7
     8Currently 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.
    129
    1310{{{
     
    2118}}}
    2219
    23 [[Image(customfields.jpg)]]
     20[[Image(DateFieldPlugin.png, 20%)]]
    2421
    25 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.
     22== Usage ==
     23 1. Install and configure
     24 2. Pick a date on tickets and milestones
    2625
    27 '''The configurable options are:'''
    28  ''format = ''::
    29    valid formats are `dmy`, `mdy`, and `ymd`
    30  ''separator = ''::
    31    possible values are `-` or `.` or `/`
    32  ''first_day = ''::
    33    let you change the first day of week (0=Sunday .. 6=Saturday) (as introduced in #1726)
     26== Installation ==
    3427
    35 '''The following options are available since [7192]'''
    36  ''months = 1''::
    37    How many months to show at once?
    38  ''milestone = false''::
    39    Use datepicker for milestone due/complete? (format= must match your locale)
    40  ''weeknumbers = false''::
    41    Show ISO8601 week numbers?
    42  ''panel = false''::
    43    Show a button panel with "Today" and "Done" buttons (at bottom)?
    44  ''change_month = false''::
    45    Show a dropdown with month selection?
    46  ''change_year = false''::
    47    Show a dropdown with year selection?
    48  ''match_request = ''::
    49    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''
     28 1. '''Install''' globally with:
     29{{{
     30  sudo easy_install https://trac-hacks.org/svn/datefieldplugin/0.11/
     31}}}
     32 1. '''Enable''' the plugin by updating TracIni file (..../trac.ini) as follows:
     33{{{
     34  [components]
     35  datefield.* = enabled
     36}}}
     37 1. '''Configure''' the project management support for the plugin in its own configuration section, placed into 'trac.ini' file as follows:
     38    1. To add a Due Date, just set up the field as a [http://trac.edgewall.org/wiki/TracTicketsCustomFields custom field], or use the CustomFieldAdminPlugin (image right) to create a date field: [[Image(customfields.jpg, right, 20%)]]
     39{{{
     40  [ticket-custom]
     41  due_date = text
     42  due_date.date = true
     43  due_date.label = Due Date
     44  due_date.value = MM-DD-YYYY
     45  due_date.date_empty = true
     46}}}
     47    1. Site-wide defaults for macro arguments may be set at [datefield] section. More details about them see [#Arguments #Arguments section].
     48{{{
     49  [datefield]
     50  format = mdy
     51  separator = -
     52  first_day = 1
     53}}}
     54 1. '''Restart''' web server on command line:
     55{{{
     56#!sh
     57    $ sudo /etc/init.d/apache2 restart
     58}}}
    5059
    51 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]
     60=== Arguments ===
    5261
    53 If you have the AutoQueryPlugin installed, you'll need to patch the DateFieldPlugin to work with it, see [http://trac-hacks.org/ticket/6796#comment:4 comment:4:ticket:6796].
     62This plugin can be controlled with a number of arguments, inside `[datefield]` section contained in `trac.ini` configuration file:
     63
     64||'''Argument'''  ||'''Version'''  ||'''Description'''  ||'''Default[[BR]]value'''
     65|| `format`|| ||The format to use for dates. valid formats are `dmy`, `mdy`, and `ymd` || `dmy` ||
     66|| `separator`|| ||The separator character to use for dates. Possible values are `-` or `.` or `/` || `/` ||
     67|| `first_day`|| >= [6118] ||First day of the week (0=Sunday .. 6=Saturday) || `0` ||
     68|| `months`|| >= [7192] ||How many months to show at once? || `1` ||
     69|| `milestone`|| >= [7192] ||Use datepicker for milestone due/complete fields? (format= must match your locale) If you turn this on, you must use `MM/DD/YYYY` for the date format. Set format to `mdy` and separator to `/`. || `false` ||
     70|| `weeknumbers`|| >= [7192] ||Show ISO8601 week number in calendar? || `false` ||
     71|| `panel`|| >= [7192] ||Show panel with a "Today" and "Done" buttons (at bottom)? || `false` ||
     72|| `change_month`|| >= [7192] ||Show a dropdown with month selection?  || `false` ||
     73|| `change_year`|| >= [7192] ||Show a dropdown with year selection?  || `false` ||
     74|| `match_request`|| >= [7192] ||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'' || `` ||
     75|| `months`|| >= [7192] ||Number of months visible in datepicker  || `1` ||
     76
     77 * 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]
    5478
    5579== Bugs/Feature Requests ==
    5680
    57 DateFieldPlugin now requires >= [trac:changeset:7982], or apply the [trac:changeset:7982] patch.  Alternatively, you can use [http://trac-hacks.org/changeset/3982?format=zip&new=3982 r3982] which is older, has more bugs and less features.
     81Existing bugs and feature requests for !DateFieldPlugin are '''[report:9?COMPONENT=DateFieldPlugin here]'''.
    5882
    59 Existing bugs and feature requests for DateFieldPlugin are
    60 [report:9?COMPONENT=DateFieldPlugin here].
     83If you have any issues, create a '''[/newticket?component=DateFieldPlugin&owner=doki_pen&cc=rjollos new ticket]'''.
    6184
    62 If you have any issues, create a
    63 [http://trac-hacks.org/newticket?component=DateFieldPlugin&owner=doki_pen&cc=rjollos new ticket].
     85=== Known issues ===
    6486
    65 == Download ==
     87 1. !DateFieldPlugin now requires >= [trac:changeset:7982], or apply the [trac:changeset:7982] patch.  Alternatively, you can use [http://trac-hacks.org/changeset/3982?format=zip&new=3982 r3982] which is older, has more bugs and less features.
     88 1. If you have the AutoQueryPlugin installed, you'll need to patch the !DateFieldPlugin to work with it, see [http://trac-hacks.org/ticket/6796#comment:4 comment:4:ticket:6796].
    6689
    67 Download the zipped source from [download:datefieldplugin here].
     90== Source & Download ==
    6891
    69 == Installation ==
     92You can check out !DateFieldPlugin from '''[http://trac-hacks.org/svn/datefieldplugin here]''' using Subversion, or '''[source:datefieldplugin browse the source]''' with Trac.
    7093
    71 Download the source zip and unzip it to a folder.
    72 
    73 From a command prompt, run 'setup.py bdist_egg'. This builds an 'egg' installation file to a new 'dist' directory.
    74 
    75 Got to your Trac Admin page, select Plugins, click Browse, select the egg file, then click install.
    76 
    77 == Source ==
    78 
    79 The 0.11 version works with Trac 0.12.
    80 
    81 You can check out DateFieldPlugin from [http://trac-hacks.org/svn/datefieldplugin/0.11 here] using Subversion, or [source:datefieldplugin browse the source] with Trac.
    82 
    83 == Example ==
    84 
    85 To enable:
    86 {{{
    87 [components]
    88 datefield.* = enabled
    89 }}}
    90 
    91 To add a Due Date:
    92 {{{
    93 [ticket-custom]
    94 due_date = text
    95 due_date.date = true
    96 due_date.label = Due Date
    97 due_date.value = MM-DD-YYYY
    98 due_date.date_empty = true
    99 }}}
    100 
    101 To configure:
    102 {{{
    103 [datefield]
    104 format = mdy
    105 separator = -
    106 first_day = 1
    107 }}}
    108 
    109 [[Image(DateFieldPlugin.png)]]
     94Download the zipped source from '''[download:datefieldplugin here]'''.
    11095
    11196== Recent Changes ==
    11297
    113 [[ChangeLog(datefieldplugin, 3)]]
     98[[ChangeLog(datefieldplugin, 2)]]
    11499
    115100== Author/Contributors ==