Set date range for a datetime picker
Purpose of this recipe
You have a datetime field in a table, and you want to limit allowed dates to a specific date range. For example, for the receipt dat/time field below, you want to limit users to specifying a date/time in the current year only.
Files to edit
hooks/tablename-dv.js
Where tablename
is the name of the table containing the datetime picker.
|
|
Now, when a user opens the date picker and tries to navigate to a date outside current year, it would be disabled: