Calendar extended
A special type of field for selecting the date and time, which has a number of additional display settings.
Date format in calendar:
Time selection function and time limit setting:
Restrict date selection
On the "Disabled Dates" tab, you can disable specific days of the week or dates selected by SQL query:
Example 1: disable future dates that have already been added to the app
select field_261 from app_entity_25 where field_261>UNIX_TIMESTAMP()
Example 2: disable future dates that have already been added to the database with the specified status
select field_261 from app_entity_25 where field_261>UNIX_TIMESTAMP() and field_255=3
Example 3: excluding dates from the selected range
In the field settings, in the "Disabled dates by SQL query" option, you need to create a special query that will return date_from and date_to. If it's returned then app will use it to exclude dates by range.
select field_226 as date_from, field_237 as date_to from app_entity_26 where field_226>UNIX_TIMESTAMP()
where field_226 and field_237 are dates fields From/To. Replace 226 and 237 to your own field ID.
Restrict time selection
The "Disabled time by SQL query" option allows you to limit the time selection in the calendar. The selected time from the SQL query will not be available in the calendar.
Example 1: we exclude the choice of a specific time
select field_175 from app_entity_22 where date_format(FROM_UNIXTIME(field_175),'%Y-%m-%d')=[TODAY]
field_175
- this is the current calendar field.
[TODAY]
- the selected day in the calendar.
Example 2: exclude a time period
select field_175 as time_from, (field_175+3600) as time_to from app_entity_22 where date_format(FROM_UNIXTIME(field_175),'%Y-%m-%d')=[TODAY]
If two dates are specified in the request: time_from
and time_to
, the app will limit the time between the two dates.