{formdate}
Sample Usage
Quick Overview Video
Settings
Setting Name | Type | Description |
---|---|---|
Positional | format | The format for the date. |
start | date | The minimum selectable date. |
end | date | The maximum selectable date. |
cols | number | The width of the form field in columns of characters. |
General Form Settings | ||
name | text | Name used for labels and data bindings. |
default | – | The default value for the form field. |
formatter | function | Formats the value of the field before snippet insertion. |
General Command Settings | ||
trim | yes/no/left/right | If yes whitespace is removed before and after the command. If left , only whitespace to the left is removed. If right , only whitespace to the right is removed. |
To learn more about forms, see the forms guide.
Formatting Dates
The {formdate}
command requires a format
setting that tells Text Blaze how to format the date when inserting. This format uses the same notation as the {time} command.
The format must contain enough information to define a complete date. So it will generally need to contain a day, month and year component. For this reason MM DD YYYY
would be a valid format but YYYY
by itself would not as it does not define a complete date.
Invalid date format as it does not define a complete date: {formdate: YYYY} Invalid date format as it does not define a complete date: {formdate: MM YYYY}
When entering dates, the date selector will use a generic format for your locale. The format you define will be used on insertion and when referring to the date's value in a formula.
Restricting Selectable Dates
You can optionally restrict the range of dates that can be selected using the start
and end
settings.
The start
and end
are dates that may be entered in the same format as the formdate's format
setting, or in a canonical YYYY-MM-DD
format. You can also embed {time} commands in order to create a dynamic range as seen in this example.
Select a date in the next 14 days: {formdate: LL; start={time: YYYY-MM-DD}; end={time: YYYY-MM-DD; shift=+14D}}