Hello,
I have made a very simple form with CF8.
There are 2 calendars in it.
What do I have to do so that after the entry in the first calendar (arrival) only one date can be selected in the second calendar (departure), which is available for selection after the date of the arrival calendar?
See screenshot.
Thank you in advance for your help.
Calendar > DateTime Limits behavior, set the name of the start date in the Start Date Field name field
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Hi kgw
using {date:....} will not work because this captures server values, but you are trying to use a live page value here
for this to work it will need some custom coding and a change to the core code which I have applied but will be available in the next update
First you can setup a trigger and listener when the arrival date changes:



the steps above listens to changes in the arrival field and sets the start date of a field named "departure" to the arrival date + 1 day
But you will need the new update for this to work
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
sure, here is the JS code so that you can use it directly:
function update_arrival(){
// Get the value of the field with ID "arrival"
let arrivalField = document.querySelector('#arrival');
let dateObject = new Date(arrivalField.dataset.date);
dateObject.setDate(dateObject.getDate() + 1);
// Format the new date back into MySQL format (YYYY-MM-DD)
const year = dateObject.getFullYear();
const month = String(dateObject.getMonth() + 1).padStart(2, '0'); // Months are 0-indexed
const day = String(dateObject.getDate()).padStart(2, '0');
// Construct the MySQL date string
const newDate = `${year}-${month}-${day}`;
document.querySelector("#departure").setAttribute("data-startdate", newDate);
}
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
I have just released the new update and you may now try this! 😊
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Hi kgw
I have added a new feature to set a fixed difference in seconds to the start date:

With this config the start date of the Departure will be 24 hours later
But this setting will come in the next update, when do you need to apply this feature ?
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
The new update is now out, it's published quickly because it fixes a core bug.
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Hi kgw
Yes, there was a bug in the document ready trigger, I have fixed this in v8.0.43, I will try to publish this in the next few minutes
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
No problem, it was an important fix, thank you for reporting it. 😊
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.