Compare two date fields

Anil74
Tera Guru

Hi All,

I have a requirement that have to compare start date and end date, if start date is greater than the end date need to show alert using on change client script.

i tried with below code but not working. any one guide me on this.

var st = g_form.getValue('u_start_time');

var et = g_form.getValue('u_end_time');

if(st > et)

{

alert("Start time should be less than the end time");

}

7 REPLIES 7

Giles Lewis
Giga Guru

Please vote for this enhancement:

Allow date/time validation and manipulation in client scripts without requiring GlideAjax

... and check out the related links on using Catalog UI Policies for date validation.

Arjun Reddy Yer
Tera Guru

Hi Giles Lewis,

Is it possible to get date automatically in the "Next Update Due" field based on Severity field.

As the "Next Update Due" field is Date Type but Severity field is String Type.

 

find_real_file.png

Giles Lewis
Giga Guru

@yerasumalli@gmail You can do this pretty easily in a Business Rule.

You only do it in a Client Script if you write a GlideAjax procedure.