Closed traut closed 5 months ago
moreover, it seems even incorrect week numbers are not caught:
$ jq -n '"2024, 99" | strptime("%Y, %W") | strftime("%Y-%m-%d")'
jq: error (at <unknown>): date "2024, 99" does not match format "%Y, %W"
$ gojq -n '"2024, 99" | strptime("%Y, %W") | strftime("%Y-%m-%d")'
"2024-01-01"
ah, this (from timefmt
lib) explains the behavior -- the value for %W
is parsed out but discarded 😞
I have implemented parsing support for week numbers locally, will soon push to the repository.
I have created a branch building with the latest timefmt-go with week number support, you can download the artifacts from here.
Resolved by 1324e6e320cff2b2eb9c778cfa1f960245ad41ad.
It looks like gojq ignores the week number during
strptime
while JQ uses it for the output date: