0

Which methods of instantiating a Javascript Date object are supported by Teamstudio Unplugged?

The following snippet gives an "Invalid Date" :-

var startDate = new Date("2015-10-27 10:00:00");
alert(startDate.toString());

Whereas this snippet returns a valid date string :-

var endDate = new Date(2015,10,27,10,00,00,00);
alert(endDate.toString());

which would suggest I can't create a Date object using "new Date(dateString)". Is this correct?

I am using the latest version of Unplugged (3.1.9) on iOS.

Martin Perrie
  • 398
  • 5
  • 16

1 Answers1

1

Unplugged uses the SpiderMonkey Javascript engine so any behavior like this comes directly from what SpiderMonkey does. From what I can see, they have had some problems with the Date() constructor but the version that Unplugged uses should be fine. The only thing I did notice is that ISO 8601 dates should have a 'T' between the date and time i.e., new Date("2015-10-27T10:00:00).

If adding the 'T' doesn't take care of it then I'll need to set up a debug build to step into SpiderMonkey and find out what's going on.

Mark Dixon
  • 48
  • 4