Compare two date fields

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-15-2017 07:02 AM
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");
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-06-2020 10:56 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-09-2020 08:19 AM
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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-09-2020 09:31 AM
You only do it in a Client Script if you write a GlideAjax procedure.