Skip to content

Change timestamp format of observations csv response to iso8601 #23

@emiliom

Description

@emiliom

The observations API when called with json or geojson (default) format returns timestamp strings in iso8601 format, eg, 2021-01-03T21:36:18.064Z. This is both compact and ideal for parsing. In contrast, csv requests return timestamp strings that are more verbose and more oriented to human eyeballs, eg, Sun Jan 03 2021 21:36:18 GMT+0000 (Coordinated Universal Time). For consistency across formats, decreased payload size, and ease of parsing, the csv timestamp strings should be changed to also be iso8601.

Response format handling is done in https://github.com/communitysnowobs/cso-api/blob/master/src/observations/format.js. I don't see any explicit timestamp formatting taking place. Instead, the divergence seems to be an outcome of different defaults in JSON.stringify vs what's done in asCSV (String(value)?).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions