setting a default time in a date and time field
Hello Roo,
You can try out something like this. The below code checks hours and minutes and if it's set to midnight, it sets minutes to be equal 10.
You can try out something like this. The below code checks hours and minutes and if it's set to midnight, it sets minutes to be equal 10.
Code: Select all
fd.field('Date').change(function(){
var hours = fd.field('Date').value()[1];
var minutes = fd.field('Date').value()[2];
if(hours == '12 AM' && minutes == '00') {
console.log('wrong');
var date = fd.field('Date').value();
//set minutes to be equal 10
date.splice(2, 1, '10');
fd.field('Date').value(date);
}
});
-
- Information
-
Who is online
Users browsing this forum: No registered users and 13 guests