-
Notifications
You must be signed in to change notification settings - Fork 8
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
add duration intermediate type documentation #91
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you'd like to finish this up, here's the remaining text you need to work into your change.
If you'd just like to contribute this and move on, let me know, I appreciate it either way.
### Duration | ||
|
||
Durations can be added to timestamps and dates. | ||
|
||
* `@2001-02-03 04:05 + 5 minutes` | ||
* `@2001-02-03 04:05 + myHours hours` | ||
* `@2021-01-01 + 5 weeks` | ||
* `@0000-01-01 + myYear years + (daysIntoMyYear - 1) days` | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for starting this.
A few notes.
- Durations can be added or subtracted.
- The legal units for durations are, i think, microseconds, milliseconds, seconds, minutes, hours, days, weeks.
- SQL durations, if the database has them, are not imported and useful as Malloy durations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. I added years
to your list of legal units 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also modified point3 for clarity.
Per: https://malloy-community.slack.com/archives/C025JAK8G0N/p1691827240356029
The duration type should be properly documented.
@mtoy-googly-moogly