GothenburgBitFactory / GothenburgBitFactory/libshared

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

Open
#46 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
7
Forks
30
Avg merge
13h 17m
Merged PRs (30d)
1

Description

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?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.