Skip to content

Suggestion: Date & Time-related GDD types #52

@nytamin

Description

@nytamin

Background

I have often found myself in situations where I need to provide timestamps to graphics.

We already have the duration-ms GDD-type for relative times.

Suggestions

date

Value represents a date, in YYYY-MM-DD, but not including the time.
GUI is recommended to display the date in a human-readable format, possibly combined with a date picker.

{
  "type": "string",'
  "gddType": "date",
  "gddOptions": {
    "min": string,
    "max": string
  },
  "pattern": "^\d{4}-\d{2}-\d{2}$",  // YYYY-MM-DD
}

(This is designed to align with https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input/date)

time

Value represents a time, in HH:mm:ss, but not including the date.
GUI is recommended to display the date in a human-readable format, possibly combined with a time picker.

{
  "type": "string",'
  "gddType": "time",
  "gddOptions": {
    "min": string,
    "max": string
},
  "pattern": "^\d{2}:\d{2}(:\d{2})?$",  // HH:mm:ss or HH:mm
}

(This is designed to align with https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input/time)

datetime-local

Value represents a time and date in YYYY-MM-DDTHH:mm:ss
GUI is recommended to display the date in a human-readable format, possibly combined with a date-time picker.

{
  "type": "string",'
  "gddType": "datetime-local",
  "gddOptions": {
    "min": string,
    "max": string
  },
  "pattern": "^\d{2}:\d{2}(:\d{2})?$",  // HH:mm:ss or HH:mm
}

(This is designed to align with https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input/datetime-local)

datetime

The value is a simplified ISO 8601 format, see: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString .
GUI is recommended to display the time in a human-readable format, possibly combined with a date-time picker.

{
  "type": "string",
  "gddType": "datetime",
  "gddOptions": {}
   "pattern": "^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z$",  // YYYY-MM-DDTHH:mm:ss.xxxZ  (in UTC)) 
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    GDD TypesThings related to the GDD typesIdeaIdeas or Proposal

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions