Noob JavaScript Date Question

G24
Kilo Sage

Hello, smart people,

Q1) How can I debug this code?  (Line 16 fails)

Bug.png

DateErrorMessage.png

 

I have been relying heavily on the "W3Schools" website.

I am having some difficulty understanding Constructor Number THREE (3) here:

https://www.w3schools.com/jsref/jsref_obj_date.asp

The constructor looks like this:  new Date(dateString);

But I'm using the ISO standard, with dashes, so shouldn't that work???  It's described here:

https://www.w3schools.com/js/js_date_formats.asp 

 

Q2) Why would the ISO date format not work in ServiceNow?

Q3 Where can I find the OFFICIAL reference on this object and this constructor?

Thank you!

5 REPLIES 5

Thanks @Sagar Pagar .  But I don't want to use the Glide objects.  I just want the regular JavaScript objects to work.