JS script to validate date in between 2 dates gives error if end date is different month
I’m trying to develop a script for Flokzu (A BPMN software that uses js scripts to define form field validations) and i’m asked to validate vacation days request fields. E.g. start date is after today and before end date. So far it works as long as the end date is within the same month; as soon as the end date is a different month, the if block kicks in. This is the code i’ve come up with so far, with corresponding translation: