13 views

Symptoms


While using Firefox, any client script / Catalog client script comparing or 'newing up' a date from a date picker in the platform are either not running or not working as expected.

 

 

Cause


Firefox is not as flexible in formatting dates as Chrome or IE

According to the MSDN Javascript documentation, the date function takes in more specific format and it happens that our standard format is one in which is invalid by Firefox's standards.

Resolution


Follow the documentation within Firefox for proper formatting before making a new date.
This is an example of what would be invalid versus valid that was tested in the console of Firefox's console

var dateFail = new Date('09-11-2018');  // This is a common date format a date field in Service Now
dateFail returns -> Invalid Date 

var newDate = new Date('2018-09-11'); 
newDate returns -> Date 2018-09-11T00:00:00.000Z

 

If you are following the formatting properly and the client script is not working properly, please open a ticket in HI referencing this KB article. 

Additional Information


https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date

Article Information

Last Updated:2018-09-17 05:56:58
Published:2018-09-14