how to prevent to date from being earlier than from date



I have 2 date fields. I need to prevent users from being able to enter a to date to be earlier than the from date. I tried the following code, but it did not work:

var currentEpoch = TYBEGM.rawValue;

var dueEpoch = TYENDM.rawValue;

var logicTest = dueEpoch - currentEpoch;

If (logicTest < 0)

{"Error! The Date Needed cannot be earlier than the current date.");

TYENDM.rawValue = "";


I'm not sure what I'm missing.

Any assistance is greatly appreciated!

Accepted Solutions (0)

Answers (0)