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

[Discussion] Best way to define date ranges? #103

Closed
hrj opened this issue Sep 9, 2016 · 5 comments
Closed

[Discussion] Best way to define date ranges? #103

hrj opened this issue Sep 9, 2016 · 5 comments
Milestone

Comments

@hrj
Copy link
Owner

hrj commented Sep 9, 2016

cc @jaa127 @Entea

Whenever date ranges are involved, there is potential for confusion between inclusive and exclusive date conditions. If the range is defined from "1st September 2016", does it include the specified date or not?

We have had long discussions about this in the past. See PR #78. We were not sure which to use:

  • begin - end
  • before - after

Yesterday, we have added the date validation feature in PR #91, where we are using from - to.

The terms from - to sound best to me; they seem to imply "inclusive" range, and I merged the PR without further thought.

However, what seems natural to me may not seem natural to others. Do others agree that the terms imply "inclusive" range?

How about making it very explicit by using fromIncluding / fromExcluding and toIncluding / toExcluding? While it will be verbose, it will be unambiguous.

Would like to hear from you all before making the next release that includes this and other changes.

@hrj hrj added this to the Version 0.3.1 milestone Sep 9, 2016
@jaa127
Copy link
Contributor

jaa127 commented Sep 9, 2016

Hi, first of congrats on 0.3 release!

Regarding time spans, imho, the most important feature is that there is inclusive start and exclusive end. There is longer explanation for this in #78 (comment).

Selecting actual words is really difficult because understanding of the meaning of terms varies even between native English speakers. One cool way to solve the problem would be implementing translation mechanism for commands.

Overall, I will have more time to work with Abandon during end of nothern hemispere autumn and during winter. There have been lots of cool stuff happening with Abandon during summer!

@Entea
Copy link
Contributor

Entea commented Sep 9, 2016

@hrj @jaa127 yeah, current implementation with exclusive dates doesn't make much sense. Making both dates inclusive would be more user-friendly. Not quite sure what the ending date should be, inclusive or exclusive. I guess what @jaa127 is suggesting looks similar to what ledger is doing - http://ledger-cli.org/3.0/doc/ledger3.html#Period-Expressions Ledger’s end dates are always exclusive, imagine the date is followed by 00:00:00 time. They are instants in time not entire days.

@hrj
Copy link
Owner Author

hrj commented Sep 10, 2016

@jaa127 @Entea

Thanks for your inputs!

Considering everything, I am going with explicitness and flexibility, even if it increases verbosity a bit. Instead of the current syntax of from:date and to date, there will be a parameter required after the date: from: date <inclusive|exclusive> and to: date <inclusive|exclusive>.

I will implement the changes now.

@jaa127 We should definitely have a mechanism for translations in Abandon.

@Entea
Copy link
Contributor

Entea commented Sep 10, 2016

@hrj Another idea of defining date ranges is to use math: dateConstraints += [2013/12/25, 2013/12/31) here [ and ] are inclusive from and to dates, ( and ) are exclusive.

@hrj hrj closed this as completed in 775d082 Sep 11, 2016
@hrj
Copy link
Owner Author

hrj commented Sep 11, 2016

@Entea Yeah, that's a good idea too. But if I am not in maths context, I sometimes can't remember which bracket has what meaning.

The support for inclusive / exclusive checks has been added, and the existing from and to syntax has been updated.

If there's enough interest for the maths notation, we could add that too.

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

3 participants