How to compare the date between GlideDate and GlidedateTime fields in an Onchange client script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2024 10:12 AM
Hi all ,
In a Form , I got Submissiojn Date & Time field (glide_date_time) and SLA Date (glide_date) fields. I am trying to write an onchange client script on SLA Date field to check if the entered SLA Date is greater than Submission Date and if not clear the SLA field value.
I am trying to convert the glide_date_time object (Submissiojn Date & Time field) to glide_date and compare with glide_date object (SLA field) with the below code.
how can I achieve it ? Please pour you Insights
Thanks in advance!!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2024 10:53 AM
All GlideDate and GlideDateTime methods are server side. You won't be able to use them client side and will need a GlideAjax and script include to use them.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2024 11:01 AM
There are two ways to do this.
Option 1: No Code date validation UI Policy
Option 2: Script Include Call