Closed andibraeu closed 11 years ago
uhh, I'm cautious with date-routines as there are so many strange time zones out there. ;) Is there any documentation clarifying which date routines are present in which JS engine?
maybe we should normalize the date stamps to UTC/GMT as it now does by default/accident (I think, there should be an additional part after the 'Z' for the timezone offset)
I've never seen an iso timestamp with timezone offset so far within the openwifimap database, so we could use this timestamp function to normalize all values before writing them to the database object?
Actually, the 'Z' means UTC and this did not happen by accident ;). The provided date has to be UTC which is (mostly) what the date validation is about... I'll check the situation again tomorrow.
According to the ECMAScript 5 documentation, the following should work in the first line of isDate
:
var date = (new Date( Date.parse(newDoc[field]) )).toISOString();
@andibraeu would you like to check this in your installation?
debian squeeze only provides ECMAScript 3, and with that version, Date.parse can't parse ISO timestamps. The function I included as workaround is from http://www.sitepoint.com/parsing-an-iso-datestamp/ I had to customize it, because they didn't deal with milliseconds.
Wow, that's really old. I see 3 possibilities:
I feel a bit uncomfortable including fallback code for outdated distributions, but I'm open for discussion. What do others think about this? @cholin @booo
At the moment I'd prefer option 2, maybe later option 1 :-)
OK, issue will be closed.
...s
could you please take a look if that could be a workaround for us? If it is, we also could start db replication