Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement display options for date & time types #428

Closed
Tracked by #250
kgodey opened this issue Jul 18, 2021 · 0 comments · Fixed by #885
Closed
Tracked by #250

Implement display options for date & time types #428

kgodey opened this issue Jul 18, 2021 · 0 comments · Fixed by #885
Assignees
Labels
type: enhancement New feature or request work: backend Related to Python, Django, and simple SQL

Comments

@kgodey
Copy link
Contributor

kgodey commented Jul 18, 2021

Problem

The Date & Time Mathesar type supports the following display options:

  • Date format
  • Time format

We will combine this into one format store.

Solution

(1) We should store these display options in the following format in the display_options field of the corresponding column.

{
  "format": "YYYY-MM-DD hh:mm A",
}

(2) We should also validate these so that:

  • Only columns of this type can have these display options. They should not be able to be set if the column is of a different type.
  • format should be a valid JavaScript date/time format.
  • We should validate format based on the type of the column. DATE columns should only include date formats, TIME column should only include time formats, TIMESTAMP columns can have either or both.

(3) If the column type is changed, the display options should be deleted.

(4) We should add supported display options to the types endpoint.

Additional Context

@kgodey kgodey added status: detail needed type: enhancement New feature or request work: backend Related to Python, Django, and simple SQL labels Jul 18, 2021
@kgodey kgodey added this to the 07. Initial Data Types milestone Jul 18, 2021
@kgodey kgodey added ready Ready for implementation needs: unblocking Blocked by other work and removed status: draft ready Ready for implementation labels Sep 13, 2021
@silentninja silentninja self-assigned this Dec 9, 2021
@silentninja silentninja linked a pull request Dec 13, 2021 that will close this issue
7 tasks
@silentninja silentninja removed the needs: unblocking Blocked by other work label Jan 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement New feature or request work: backend Related to Python, Django, and simple SQL
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

2 participants