pimutils / pimutils/khal

incorrectly evaluates datetime range for locale '%Y%m%d'

Open
#871 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

pri:Low type: bug
Dominant language
Python
Stars
3.1k
Forks
233
Avg merge
1h 44m
Merged PRs (30d)
1

Description

When dealing with dates in November or December, the resolving of the provided date evaluates to a past January 1st date. (Note: this bug only occurs for these months. Probably something to do with the month numeral being 11 and 12).

Locale section of config file:

[locale]
timeformat = %H%M
dateformat = %Y%m%d
longdateformat = %Y%m%d
datetimeformat = %Y%m%d%H%M
longdatetimeformat = %Y%m%d%H%M
default_timezone = America/Chicago

Confirming locales:

$ khal printformats
longdatetimeformat: 201312211009
datetimeformat: 201312211009
longdateformat: 20131221
dateformat: 20131221
timeformat: 1009

The bug can be seen when running:

khal list 20191128   # some date in november or december. It spits back the results for January 1st

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue with the shown locale configuration by running khal printformats and khal list 20191128. Trace how the %Y%m%d date format is parsed and resolved, comparing November and December with other months. Done means dates in those months resolve to the requested date rather than January 1st, with regression coverage for the reported command.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.