Skip to content

[pull] master from scrapinghub:master - #104

Merged
pull[bot] merged 1 commit into
zanachka:masterfrom
scrapinghub:master
Aug 28, 2026
Merged

[pull] master from scrapinghub:master#104
pull[bot] merged 1 commit into
zanachka:masterfrom
scrapinghub:master

Conversation

@pull

@pull pull Bot commented Aug 28, 2026

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

)

* Improve Czech (cs) language data (#1172)

- Add month locative/dative forms (lednu, únoru, březnu, dubnu, květnu,
  červnu, červenci, srpnu, říjnu, prosinci) for dates like "v lednu 2023"
- Add July abbreviation "črv"
- Fix "za měsíc/týden/rok" not parsing: add accusative simplification
  patterns (previous patterns only matched instrumental -em forms)
- Add tests covering the new expressions

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>

* Reject a %j day of year that the parsed year does not have

datetime.strptime resolves a day of year past the end of the parsed year
into the next year, so day 366 of a non-leap year became January 1 of the
following year:

    >>> dateparser.parse("1999366", date_formats=["%Y%j"])
    datetime.datetime(2000, 1, 1, 0, 0)

The returned year contradicted the year in the input, and invalid values
were rejected inconsistently: day 367 gave None while day 366 gave a date.

The std lib keeps the value it read for %j in struct_time.tm_yday even
after rolling the date into the next year, so the rollover can be spotted
by comparing it with the day of year of the resulting date. When the two
differ, strptime() now raises ValueError, which parse_with_formats()
already handles as "this format does not match".

_prepare_format() now also reports whether the format holds a real %j
directive, so that an escaped "%%j" literal is not mistaken for one.

Fixes #271.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@pull pull Bot locked and limited conversation to collaborators Aug 28, 2026
@pull pull Bot added the ⤵️ pull label Aug 28, 2026
@pull
pull Bot merged commit 6b5f17d into zanachka:master Aug 28, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant