Skip to content

Parse Finnish dates with "klo" preposition #1268

@AleksMa

Description

@AleksMa

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)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions