{formdate}
Sample Usage
Quick Overview VideoSettings
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.
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 form commands and their capabilities, 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.
Click here to learn about time/date formatting in Text Blaze.
The format
setting must contain enough information to define a complete date. Generally, the date needs to contain at least 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 a date via the {formdate}
in the form popup, the date selector will use the same format that you define in the {formdate}
's positional setting.
Also, the same format will be used when using the date 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
settings 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}}