The edit-date macro provides a user interface that combines the features of a text input (
<$edit-text>widget) with "edit-in-place" (save/cancel/delete) buttons and a popup monthly calendar. This allows you to enter custom text or select and format a date from the calendar.
The macro supports a subset of the parameters allowed by the
<$edit-text>widget:
Parameter Description tiddler The tiddler in which to save the input (default= <<currentTiddler>>)field The field in which to save the input (default= date)format The TiddlyWiki Date Format used to store a date selected from the calendar (default= YYYY/0MM/0DD)default text to be used when the target field doesn't exist placeholder text to display when the target field is empty (default="select or enter a date") size The size of the input field in characters (default= 20)focus Set to "yes" or "true" to automatically focus the input after creation class A CSS class to be assigned to the generated HTML editing element
- Use
<<edit-date field:fieldname>>to embed a date input field in tiddler content.- Unlike the
<$edit-text>widget, the<<edit-date>>macro allows you to input values that are stored in the current tiddler.- When the field receives the input focus, a set of "edit-in-place" buttons and a monthly calendar are displayed.
- [checkmark] saves changes to the field value. [X] cancels changes to the field value. [trashcan] deletes the field value.
- [<<] displays the previous month. [>>] displays the next month.
- Click a date to set the edit field contents using the indicated TiddlyWiki Date Format codes.
- You can override the default date format (
YYYY/0MM/0DD) by entering a new format directly in the calendar popup.- Note: if TiddlyTools/Timer/Calendar is not installed, the calendar popup is not displayed.
simple-date: <<select-date simple-date>><br>
<<delete-date simple-date>><br>
<<simple-date simple-date 0DD.0MM.YYYY>><br>
Start-date: <<date-field start-date "DDth of MMM, YYYY">>\define select-date(fieldname)
<$set name=date-field value="$fieldname$" emptyValue="date-field">
<$edit-text tiddler="$:/temp/date" type=date tag="input" />
<$list filter="[{$:/temp/date}!is[blank]]" variable=nul>
<$button tooltip={{{ [[$fieldname$]addprefix[Set ]addsuffix[ to selected date]] }}} actions=<<set-date-actions>> >
<$list filter="[all[current]has<date-field>]" emptyMessage="Set" variable=nul>Reset</$list>
</$button>
</$list>
</$set>
\endThe "edit-in-place" feature is very useful for me since it reduces the need to use a second "remote" tiddler to easily edit a field.