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

Understand that the second time value is in the future #14

Open
KennethSundqvist opened this issue May 10, 2019 · 2 comments
Open

Understand that the second time value is in the future #14

KennethSundqvist opened this issue May 10, 2019 · 2 comments

Comments

@KennethSundqvist
Copy link

I often use two time values to calculate between today and tomorrow, but the calculator always treat both time values as the same day, no matter which order they are in.

Both dcalc 01:00 - 22:00 and dcalc 22:00 - 01:00 result in 21 hours. I expect the latter to result in 3 hours.

If I include the dates for today and tomorrow, like dcalc 2019-05-10@22:00 - 2019-05-11@01:00, i get 3 hours.

And using the @time format with date keywords, like today@22:00, doesn't work, so I always have to type the full date.

@MuppetGate
Copy link
Owner

Yes, I see what’s happened there. I run the calculation so that folk can put the dates in any order and get the difference between them. That doesn’t work for times though does it (unless you put in the full date). Mmm.

The second one is interesting because I hadn’t thought of parsing the expression like that. It would lead to a horrendous amount of error checking, but perhaps for a limited number if special cases …

I’ll think about both of those when I have more time. I’m snowed under at the moment.

@KennethSundqvist
Copy link
Author

Using the @time format with date keywords is not a priority for me, and I don't consider it a part of this issue. I only mentioned it as a possible solution to use other than handling the second time value as a time in the future. But since you say it's complicated to implement you don't have to consider it for this issue.

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

2 participants