Date scripts for DD/MM/YYYY
I currently have this custom validate script.
- event.rc = true;
if (event.value) {
var d = util.scand("dd/mm/yyyy", event.value);
if (d==null) {
app.alert("Please enter a date in dd/mm/yyyy format.");
event.rc = false;
} else if (d.getFullYear()<1900 || d.getFullYear()>2100) {
app.alert("Error! Invalid year.");
event.rc = false;
}
}
This works well except it will allow you to put letters 10/nov/2018 and nov/10/2018. I need only numbers and slashes in the field (no letters for month).
What can I add to this script to make this happen?
Format/Date/Custom, does not work with script.
And without script they can enter "01/01/0994"
Format number no decimal, does not work with script either.
