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 Duration type #433

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

Implement display options for Duration type #433

kgodey opened this issue Jul 18, 2021 · 0 comments · Fixed by #1091
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 Duration Mathesar type supports the following display options:

  • Min unit
  • Max unit
  • Whether to show unit labels

We will combine this into a single format string.

Solution

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

{
  "format": "HH:mm:ss.SSS"
}

(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 duration format.

(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 changed the title Implement display options for duration type Implement display options for Duration type Sep 13, 2021
@kgodey kgodey added needs: unblocking Blocked by other work and removed status: draft labels Sep 13, 2021
@silentninja silentninja added ready Ready for implementation and removed needs: unblocking Blocked by other work labels Feb 16, 2022
@silentninja silentninja added status: started and removed ready Ready for implementation labels Feb 21, 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