I have a form with a date-picker.
I should make sure that if the user clicks on a day longer than the current 60 days, a warning text or message appears (not blocking, must be able to continue). How can I achieve this?
Here is the current calendar code
<input type="text" class="form-control" id="inp_data2frm" name="data2frm" aria-describedby="inp_data_help" is="dmx-date-picker" format="DD/MM/YYYY" showweeknumbers="true" weeklabel="Sett." data-msg-required="Mandatory" readonly="true" dmx-bind:invaliddates="dataoff.data.query" invaliddates-start="data_inizio" invaliddates-end="data_fine" placeholder="> click here to show calendar">
You can add an inline flow with a condition to show a notification like this. Bind it to the datetime var in your project and adjust the days as needed.
<input id="date1" name="date1" is="dmx-date-picker" dmx-bind:value="datedaylocal.datetime" dmx-on:updated="run({condition:{outputType:'boolean',if:`value>datedaylocal.datetime.addDays(59)`,then:{steps:{run:{outputType:'text',action:`notifies1.warning(\'The selected value is 60 or more than 60 days in the future: \'+value)`}}}}})" timepicker="" minutes-increment="60">
Another solution would be to show a notification below the calendar:
<dmx-datetime id="var1" interval="hours"></dmx-datetime>
<input type="text" class="form-control" id="inp_data2frm" name="data2frm" aria-describedby="inp_data_help" is="dmx-date-picker" format="DD/MM/YYYY" showweeknumbers="true" weeklabel="Sett." data-msg-required="Mandatory" readonly="true" dmx-bind:invaliddates="dataoff.data.query" invaliddates-start="data_inizio" invaliddates-end="data_fine" placeholder="> click here to show calendar">
<div class="alert mt-2" id="alert1" is="dmx-bs5-alert" role="alert" type="warning" dmx-bind:show="var1.datetime.daysUntil(inp_data2frm.value)>=60">
<p>Selected date is more than 60 days from today.</p>
</div>