Update: Apple replied to my bug report that this issue is fixed in the latest version of Safari though you may still want to use this workaround to be compatible with older version of Safari.
var dd = new Date(device.last_modified);
Then I ran the same App on Safari and the date operation failed, Safari’s implementation of Date() returned “Invalid date”.
This was the fix, that made every browser happy:
var dd = new Date(device.last_modified.replace(/-/g, “/”));
I’ve raised a bug with Apple since the use of the dash character is, in fact, an international standard and Apple really ought to bring Safari up to speed.