-
Notifications
You must be signed in to change notification settings - Fork 42
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
dateseq range appears to have an incorrect interval #131
Comments
I forgot to ask but is there a better way to generate a range like this? E.g. It would be nice if the following worked: |
I have noticed that: $ dateadd -i %m 09 1mo -1d
2021-09-29
$ dateadd -i %m 09 1mo
2021-10-00 Days seem to be off by one in a weird way. EDIT: The day part of the date is initialised to 0 instead of 1. Is this intended? $ dateadd -i %m 09 0d
2021-09-00
$ dateadd -i %m 09 1d
2021-09-01 |
Hi Emanuele, The other issue you're running in, are before-the-first-of-the-month dates. Examples include:
They exist so you can "assemble" a date:
They obviously fail for negative summands in the way they are implemented now. You tracked down the issue with dateseq correctly, it starts (because you only specify a month) on 2021-09-00. And dateseq fails to display the first result as such, instead 2021-08-31 (the true day before the first of the month in September) is printed. This, too, is easily fixable. The bigger underlying problem of coming up with a sane set of rules for zeroed out dates remains (for now). |
Surely it should be I would never use |
Well, you used the feature, in your initial dateseq call, by only specifying a month. |
I didn't use |
… in the boundaries, addresses issue #131
* bug/131: fix, pretend to be a day ahead when subtracting business days on nil dates test, add regression cases for subtraction of zeroed dates fix, for nilled days or months define subtraction to start form month's or year's first test, add regression cases for issue 131 fix, do not resort to daisy sequences when noughted dates are present in the boundaries, addresses issue #131 doc, %m is in the range of 00 to 12
When attempting to use
dateseq
to produce a list of days for a given month I've noticed it to include the last day of the prior month, for example:I would have expected this to produce a range starting at
2021-09-01
and ending on2021-09-30
.(Perhaps there is also an issue with how
%m
is defined in the manual as it claims to have a range from00
to19
butdateutils
won't accept19
as an input for%m
. I should expect this to be01-12
instead.)The text was updated successfully, but these errors were encountered: