18 January 2026:
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
This forum is now archived and is in read-only mode. Please continue discussions on our improved new Sahi Pro Community forum.
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
Alerting a date causes a syntax error
Hi Guys,
An interesting one:
I do the following:
And this leads to a syntax error of:
Anyway around this? I've also tried using _set before alerting but doesn't seem to help...
An interesting one:
I do the following:
$d = new Date($d[2],$d[1],$d[0]);
_alert($d);
And this leads to a syntax error of:
_sahi.setServerVar('\$d', Thu May 06 2010 00:00:00 GMT+0100 (IST));
SyntaxError: missing ) after argument list
Anyway around this? I've also tried using _set before alerting but doesn't seem to help...
Comments
When the date is alerted it does not seem to recognize it as a string.
Do this:
$d = new Date($d[2],$d[1],$d[0]);
$ds = "" + $d;
_alert($ds);
Regards,
Narayan