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

add duration intermediate type documentation #91

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

vitiral
Copy link

@vitiral vitiral commented Aug 22, 2023

@mtoy-googly-moogly mtoy-googly-moogly self-requested a review August 31, 2023 15:56
Copy link
Contributor

@mtoy-googly-moogly mtoy-googly-moogly left a 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.

Comment on lines +129 to +137
### 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`

Copy link
Contributor

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.

  1. Durations can be added or subtracted.
  2. The legal units for durations are, i think, microseconds, milliseconds, seconds, minutes, hours, days, weeks.
  3. SQL durations, if the database has them, are not imported and useful as Malloy durations.

Copy link
Author

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 😄

Copy link
Author

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.

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

Successfully merging this pull request may close these issues.

2 participants