Skip to content

sod, som, soy etc do not seem to work as documented #46

@smemsh

Description

@smemsh

when writing tests for something else I discovered this:

 $ date
Fri Jul 16 21:30:41 PDT 2021

 $ task calc soy
2021-01-01T00:00:00

 $ task calc sod
2021-07-16T00:00:00

 $ task calc som
2021-07-01T00:00:00

(same in 2.5.3 and 2.6.0 trunk) but all the documentation says that soX should be start of the next X. Is this known behavior that has changed somewhere, or am I misunderstanding the description from man page:

            Start  of  next  (work)  week (Monday), calendar week (Sunday or
              Monday), month, quarter and year
                     task ... due:sow
                     task ... due:soww
                     task ... due:socw
                     task ... due:som
                     task ... due:soq
                     task ... due:soy

this seems confusing, there is "start of next ..." and "end of current" documented, but nothing for "start of current" which seems to be the actual behavior (not "next"). The tests in libshared/test/datetime.t.cpp seem to agree with the behavior:

    Datetime r19a ("soy");
    t.ok (r19a.sameYear (now), "soy in same year as now");
    t.ok (r19a < now,          "soy < now");

but my understanding of the phrase "start of next " means that by definition, it's in the future. What am I missing?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions