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

Duration Datatype #129

Open
theduke opened this issue Jul 15, 2022 · 2 comments
Open

Duration Datatype #129

theduke opened this issue Jul 15, 2022 · 2 comments

Comments

@theduke
Copy link

theduke commented Jul 15, 2022

Define a datatype for specifying a duration.

The main question is if millisecond precision is enough, or if sub-millisecond precision is required often enough.

I lean towards just specifying it as milliseconds.

@joepio
Copy link
Member

joepio commented Jul 16, 2022

Creating a new datatype or not is a tough decision. I tend to gravitate to keep the amount of datatypes to a minumum. If a datatype can actually be represented as a Property, things are often far easier.

Basically, as a rule of thumb, I currently always ask the question: does this new datatype require a new type of input for forms? And if it does, is the datatype reusable in multiple semantic relationships?

For Duration, I think there are definitely scenarios were I'd expect a new type of form. For example if I'm planning a holiday on AirBnB I want a date-range select. And in a calendar appointment, too. But these make more sense to represent as two seperate fields: start-date and end-date.

Which usecases did you have in mind? Can you come up with multiple Properties that would use this datatype?

@theduke
Copy link
Author

theduke commented Jul 17, 2022

I tend to gravitate to keep the amount of datatypes to a minumum

I concur, but duration is a common type which has a distinct semantic meaning not subsumed by a timestamp or a plain integer.

Example use cases:

  • duration of a video or audio file
  • duration worked on a task in a time tracking app
  • duration of a page visit in an analytics tracker
  • ...

I think it's common enough and distinct enough to have a dedicated core datatype.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants