Just to help I gave ChatGPT4 the content of $:/plugins/yaisog/widgets/datepicker.js and asked for syntax instructions;
- With a bit of massaging I got this;
- So we can now quickly document someone else’s JavaScript solutions.
DatePickerWidget Syntax Instructions
1. Basic Usage
To include the date picker widget in your TiddlyWiki, use the following syntax:
<$edit-date/>
2. Customizing Attributes
The widget supports various attributes that allow customization. Here's a description of each attribute and how to use them:
-
format: The date format displayed in the input field (default: "YYYY-MM-DD").
<$edit-date format="YYYY-MM-DD"/>
-
firstDay: The first day of the week, 0 for Sunday, 1 for Monday, etc. (default: 0).
<$edit-date firstDay="1"/>
-
fieldFormat: The format used to save the date in the specified field (default: "[UTC]YYYY0MM0DD0hh0mm0ss0XXX").
<$edit-date fieldFormat="[UTC]YYYY0MM0DD"/>
-
tiddler: The title of the tiddler where the selected date will be saved (default: the current tiddler).
<$edit-date tiddler="MyTiddler"/>
-
field: The field in the tiddler where the date will be saved (default: "created").
<$edit-date field="duedate"/>
-
index: The index in the tiddler where the date will be saved.
<$edit-date index="myIndex"/>
-
class: The CSS class to apply to the input field.
<$edit-date class="my-custom-class"/>
-
placeholder: The placeholder text for the input field.
<$edit-date placeholder="Select a date"/>
-
tag: The HTML tag used for the input field (default: "input").
<$edit-date tag="input"/>
-
attributes: The tiddler containing a JSON object with additional HTML attributes for the input field.
<$edit-date attributes="MyAttributesTiddler"/>