rdf-ext / rdf-parser-csvw

CSV on the Web parser
MIT License
16 stars 4 forks source link

parseDateTime: keep local timezone by default #15

Closed vhf closed 5 years ago

vhf commented 5 years ago

Here's a solution to #14 .

Note that parseDateTime() doesn't return a string anymore. This makes it possible to properly display the date that was parsed.

Returning a string would require re-parsing the output of parseDateTime() in order to display in another timezone or in another format than ISO, which will sometimes be necessary. (See for instance how it is needed here: https://github.com/rdf-ext/rdf-parser-csvw/blob/de6da70bd72e5a20b49ef9c7eeb5915a514e3770/lib/metadata/TableSchema.js#L131 )