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

Interval construction by "earlier" or "later" durations #12

Open
erikc5000 opened this issue Oct 29, 2019 · 0 comments
Open

Interval construction by "earlier" or "later" durations #12

erikc5000 opened this issue Oct 29, 2019 · 0 comments
Labels
design Design issue/question enhancement New feature or request

Comments

@erikc5000
Copy link
Owner

When constructing intervals, it would be nice to support a syntax like:

for (date in today until 1.weeks.later) {
    // ...
}

for (date in 1.weeks.earlier until today) {
    // ...
}

It reads a bit nicer than:

for (date in today until today + 1.weeks) {
    // ...
}

for (date in today - 1.weeks until today) {
    // ...
}

The ".earlier" and ".later" would just be syntactic sugar around a duration unit, but at no added expense if implemented using an inline class. We could forego the the sugar and use the durations directly, but it's a little less clear.

for (date in today until 1.weeks) {
    // ...
}

for (date in 1.weeks until today) {
    // ...
}
@erikc5000 erikc5000 added enhancement New feature or request design Design issue/question labels Oct 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design Design issue/question enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant