dateparser icon indicating copy to clipboard operation
dateparser copied to clipboard

Parse Finnish dates with "klo" preposition

Open AleksMa opened this issue 7 months ago • 0 comments

dateparser cannot recognize Finnish dates with "klo" inside.

Code that reproduces the issue

import dateparser
dateparser.parse("28 maalis klo 9:37")

Expected behavior

The above code should return datetime.datetime(2025, 3, 28, 9, 37)

Observed behavior

The above code returns None.

Notice that dateparser correctly deals with forms without "klo":

>>> dateparser.parse("28 maalis 9:37")
datetime.datetime(2025, 3, 28, 9, 37)

It also works when "klo" is added to SKIP_TOKENS settings:

>>> dateparser.parse("28 maalis klo 9:37", settings={"SKIP_TOKENS":["klo"]})
datetime.datetime(2025, 3, 28, 9, 37)

AleksMa avatar Apr 27 '25 06:04 AleksMa