MuppetGate / Alfred-Workflows-DateCalculator

Date Calculator workflow for Alfred
42 stars 6 forks source link

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

Open KennethSundqvist opened 5 years ago

KennethSundqvist commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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.