Calendar fields in forms
The calendar type field lets users select a date on a form by clicking the date in the calendar popup.
To configure the calendar field, click the pencil icon, as shown in the image below.
Under the Basics tab, it’s possible to edit the Label, Client ID, and Class.
You can also choose checkboxes for Disabled, Read Only, Hidden, or Initialize with Today’s Date, the latter of which will automatically enter the date on which the form started.
Validation
Under the Validation tab, it’s possible to specify that the calendar field is required. You can also allow users to only select future dates, and you can specify a range of minimum and maximum dates.
It’s also possible to choose an absolute date or a relative date.
Absolute dates
Specify an exact date by selecting Absolute from the Type dropdown and entering a static date.
Relative dates
Describe the date by selecting Relative from the Type dropdown. Relative date limits are calculated every time a form is presented to the user.
Some examples of relative dates are:
-
The first of next month
-
The last day of the month
-
The first day of March
-
The last day of the month
After selecting your date input, you’ll see the date relative to the current date on the right side. This date could change at the form run time.
Guidelines when using text to describe your limits
When using relative dates, here are some guidelines to consider.
-
Start of week — Weeks start on a Monday, and next week will run from Monday morning to Sunday night.
-
Future bias — May 7th will prefer a May 7th in the future.
-
This/next/last — Weeks or months with this text, e.g. this/next/last week, are mostly straightforward.
-
This monday
-
monday will always refer to itself or the upcoming monday.
-
Saying this monday on a Monday is the day itself.
-
Saying this monday on a Tuesday is next week.
-
Likewise, this june in June is June itself. this june in any other month is the next June in the future.
-
-
Last monday
-
If it’s Tuesday, last monday will not mean yesterday.
-
Saying last monday on a Tuesday will be -1 week.
-
Saying a week ago monday will also work.
-
Saying this past monday will return yesterday.
-
-
Next wednesday
-
If it’s Tuesday, next wednesday will not be tomorrow. It’ll be a week after tomorrow.
-
Saying next wednesday on a Tuesday will be +1 week.
-
Saying a week wednesday will also be +1 week.
-
Saying this coming wednesday will be tomorrow.
-
-
Nth week — The first week of a month or a year is the first week with a thursday in it. As expected, first monday of January will always be in January.
-
Seasons — By default, this summer will return June 1 – Sept 1, which is summer in the Northern Hemisphere. You can use something like first day of summer.
-
Invalid dates
-
january 34th 2020 will return Jan 31 2020.
-
6th week of february will return the second week of March.
-
-
Miscellaneous
-
thursday the 16th will be set to the 16th, even if it’s not a Thursday.
-
in a few years will set to two years from now.
-
For more examples and guidelines, refer to the documentation.