validation

A custom validator for checking Start time field depending on the value of End Time

In one project I use two independent date fields "Start Time" and "End Time". Both fields are optional, indecencies and don't know about each other. However, if "End Time" is selected, I need to check "Start Time" and display a message, so the first field shouldn't be empty and "End Time" should be greater or equal. This code shows a solution how to implement.

A custom validator for checking the field depending on the value of another field

In one project I use two independent date fields "Start Date" and "End Date". Both fields are optional. But if "End Date" is selected, I need to check "Start Date", so the first field shouldn't be empty and "End Date" should be greater or equal. This code shows how I implemented the solution.