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.