Query about Data Input ‘Date’ field

Is there an option to freeze the previous days in the calendar for the Data Input ‘Date’ field, to prevent the user from selecting past date in the calendar?

You must be logged in to view attached files.
Posted: May 25, 2021 at 12:26 pm
Replies: 1
Jun 2, 2021
Posted by Patrick Burma

I am not that familiar with the inner workings of the calendar widget so it might be possible, but what I think I would probably do is use the data binding and the on change event to check if the data selected is greater than now and if yes set it to the now date/time.

Something like:

var now = new Date(); //Use the correct syntax for ISO date/time format

//Create a page variable called datetime then add the if statement into the on change event

if(page.data.datetime > now){
page.data.datetime = now;

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
© Vantiq 2024 All rights reserved  •  Vantiq Corporation’s Privacy Policy and Cookie Policy