Alfred-Workflows-DateCalculator icon indicating copy to clipboard operation
Alfred-Workflows-DateCalculator copied to clipboard

Date miscalculation

Open truthdoug opened this issue 8 years ago • 2 comments

Today I installed this workflow and tried a couple calculations. One was off by a month.

After setting my date format to 'YYYY-MM-DD', I tried:

dcalc today - 2016-05-31

I get 2 months, 1 day. But today is Sept. 1, so two months ago was July 1 and one day before that was June 30 -- not May 31.

If I try the reverse:

dcalc today - 2m-1d

I get 2016-06-30

truthdoug avatar Sep 01 '16 17:09 truthdoug

I just tried adding the d to the original query and got a better answer:

dcalc today - 2016-05-31 d

returns 93 days

truthdoug avatar Sep 01 '16 17:09 truthdoug

Yes, this having thought bout this a lot, I need to really keep the calculation in days, which is the root of the problem. I'll sort out a fix. Thanks for reporting it.

I shouldn't really be doing sums with months because they don't have an even number of days. Time to simply things a bit I reckon.

MuppetGate avatar Sep 01 '16 17:09 MuppetGate