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 Period type #3818

Merged
merged 29 commits into from
Oct 28, 2022
Merged

Add Period type #3818

merged 29 commits into from
Oct 28, 2022

Conversation

Akirathan
Copy link
Member

@Akirathan Akirathan commented Oct 20, 2022

Pull Request Description

This PR adds Period type, which is a date-only complement to Duration builtin type.

Important Notes

  • Period replaces Date_Period, and Time_Period.
  • Added shorthand constructors for Duration and Period. For example: Period.days 10 instead of Period.new days=10.
  • Period can be compared to other Period in some cases, other cases throw an error.

Checklist

Please include the following checklist in your PR:

  • The documentation has been updated if necessary.
  • All code conforms to the
    Scala,
    Java,
    and
    Rust
    style guides.
  • All code has been tested:
    • Unit tests have been written where possible.
    • If GUI codebase was changed: Enso GUI was tested when built using BOTH
      ./run ide build and ./run ide watch.

@Akirathan Akirathan self-assigned this Oct 20, 2022
@Akirathan Akirathan force-pushed the wip/akirathan/period-183336003 branch from 0967404 to bfa068f Compare October 21, 2022 10:27
@Akirathan Akirathan marked this pull request as ready for review October 21, 2022 10:27
Copy link
Contributor

@hubertp hubertp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor nits, looks OK otherwise

Copy link
Member

@JaroslavTulach JaroslavTulach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fine from my "engine" perspective.

@Akirathan Akirathan force-pushed the wip/akirathan/period-183336003 branch from 5db7413 to edf289e Compare October 26, 2022 13:35
Copy link
Contributor

@4e6 4e6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@Akirathan Akirathan force-pushed the wip/akirathan/period-183336003 branch from ba6ff98 to 79ee0b4 Compare October 27, 2022 09:50
Copy link
Member

@jdunkerley jdunkerley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally looks good but am not sure about the == and compare_to - adding the starting date feels wrong to me.

@jdunkerley
Copy link
Member

LGTM - will want to add these types to default Base exports but will do as part of the great tidy up...

@Akirathan Akirathan added the CI: Ready to merge This PR is eligible for automatic merge label Oct 28, 2022
@mergify mergify bot merged commit f8a4e2a into develop Oct 28, 2022
@mergify mergify bot deleted the wip/akirathan/period-183336003 branch October 28, 2022 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI: Ready to merge This PR is eligible for automatic merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants