{date-data}
Plugin: Scaffolding Plugin
Allows editing of dates in a series of drop-down boxes.
Usage
Parameters
| Name |
Required |
Default |
Description |
| [default]/name | | | The name of the field. |
| format | | | The format to display the date in. May contain any of the following special characters:
- y - The year (eg. 'yy' = '05', 'yyyy' = 2005).
- M - The month (eg. 'MMMM' = 'April', 'MMM' = 'Apr', 'MM' = '04').
- d - The day (eg. 'dd' = '09', 'd' = '9').
- H - The hour - 24 hour time (eg. 'HH' = '13').
- h - The hour - 12 hour time (eg. 'h' = '1', 'hh' = '01').
- m - The minute (eg. 'mm' = '23').
- s - The second (eg. 'ss' = '14').
- a - AM/PM (eg. 'a' = 'PM').
|
| minYear | | -10 | The minimum year that is allowed. May be absolute (eg. '1980') or relative to the current year (eg. '-5'). |
| maxYear | | +10 | The maximum year that is allowed. May be absolute (eg. '2020') or relative to the current year (eg. '+15'). |
| required | | false | If true, the field cannot be empty. |
Recipes
Is it possible to have a date-picker type of input from a calendar, rather than a tedious 3-step process of picking a date?
You have my vote Appan!
If you'd like to see new features the best way is to create a feature request - new work done in future versions is scheduled from there - page comments tend to get missed. You can vote for them there too
If I set minYear to -1, what will happen if I try to go back and edit the form again in 2 years? Will the original year I selected be unavailable?
You are correct - it will always be relative to the current year. Usually I tend to fix the minYear to a particular value and set the maxYear to a relative one. Eg {date-data:My Date|minYear=2005|maxYear=+0} will limit the range to 2005-present.
Is it possible to set the the default date to a week in the future, that is, when the user creates a new page based on a template with my date-data field, I want the date entered to be a week from then... I could only find tomorrow, today, etc.?
We've got the same question. It looks like one can put a "fixed" date sometime in the future, but how would one make it a week or two from now? Perhaps used with the replace and render macro?
I believe you are correct, currently there is no way to specify that. The obvious thing would be to add a feature similar to date-filter, where you can specify "+2d" or similar.
If you create a feature request I'll schedule it to be implemented.
I'll submit a feature request. As a work-around, is there some way that calculations could be performed using global:current date? For example, {report-info:global:current date > date:yyyy-MM-dd} allows the date to be calculated/displayed. Is it possible to use replace-and-render and report-info to pull out various date values (year, month, day), add something to the day variable, and insert it as a "fixed date" ?
Not that I can think of. I though of that too, but couldn't find anything that would do the increment. Possibly another feature request-worth idea - add the functionality to the Date Supplier...