Skip to content

Inconsistency in DatasetVersionInfo model? (Date vs string) #476

Description

@vera

I noticed that in the DatasetVersionInfo model, the timestamps use inconsistent types:

createTime: Date
/**
* The timestamp of the last update to this dataset version.
* Format: ISO 8601 string (e.g., "2023-06-01T12:34:56Z").
* Used for optimistic concurrency control to detect concurrent updates.
*/
lastUpdateTime: string
releaseTime?: Date

releaseTime and createTime are represented as Date objects, while lastUpdateTime is represented as an ISO 8601 string and not transformed into a Date object:

createTime: new Date(versionPayload.createTime),
lastUpdateTime: versionPayload.lastUpdateTime,
releaseTime: new Date(versionPayload.releaseTime),

The return values from the Dataverse API for retrieving a dataset version are all consistently ISO 8601 strings:

Image

I was wondering what the reason for this is, or whether this inconsistency should be cleaned up? (If so, I'd be open to opening a PR for that)

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