Skip to content

Adding a DateTime primative #556

@erikmaas-malmberg

Description

@erikmaas-malmberg

Is your feature request related to a problem? Please describe.
Dates and times are always strange types to work with.
Let's make it easy by predefining a DateTime primitive.
In this Primitive one can specify how this is formatted and / or constrained.
Using proper DateTime specifications it's easier to understand what is going on.
Compare:

// Iso 8601 DateTime
type DateTime = String(/^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])T([01]\d|2[0-3]):([0-5]\d):([0-5]\d)(\.\d+)?(Z|([+-](0\d|1[0-2]):([0-5]\d)))?$/g)

With

type IsoDateTime = DateTime(ISO_8601)
//or
type IsoDateTime = DateTime(yyyy-MM-dd'T'HH:mm:ss.SSSZ)

Describe the solution you'd like
A proper DateTime primitive supporting a way to specify how this DateTime is formatted with pre-formats and with simple formatting language.

Requirements
A proper DateTime primitive supporting a way to specify how this DateTime is formatted with pre-formats and with simple formatting language.
The default DateTime should use the ISO_8601 spec as this is an ISO defined standard

Additional information
For further reading sources that triggered your feature wish

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions