When trying to submit a change request in our ServiceNow instance, an invalid start date error is showing up.


[code]Solution: [/code]

The root cause of the issue is with the Client Script which has a invalid way of checking the format of the script.

For Example 

In this client script's code:

At line 18:

if ( {
var start_date = g_form.getValue('start_date');
var date_format = user.date_format;
if (date_format == '')
date_format = 'yyyy-MM-dd';
var time_format = user.time_format.substr(0, 4);
if (time_format == '')
==> time_format = 'HH:mm:ss';
var time_date_format = date_format + ' ' + time_format;
var start_date_value = getDateFromFormat(start_date,time_date_format);


The script is written to check the time as 'HH:mm', but the time is set as 'HH:mm:ss'. Due to this reason the error is showing up.

The validation of the date or time should be in the exact format as the way the system displays.

Article Information

Last Updated:2019-11-21 07:48:18