Skip to content

Parsing relative dates error with Indonesian #912

@kss149

Description

@kss149

Parsing relative dates for month ("bulan"/"bln") and year ("tahun"/"thn") only works with the partial words ("bln" and "thn"), but not the full words ("bulan" and "tahun").
Ideally, it should work for both.
This is what I get when I run it with the latest version of dateparser(==1.0.0).

>>> dateparser.parse("4 tahun lalu")
datetime.datetime(2020, 4, 28, 20, 9, 57, 154047)            1 year ago -> incorrect
>>> dateparser.parse("4 thn lalu")
datetime.datetime(2017, 4, 28, 20, 10, 30, 770866)           4 years ago -> correct
>>> dateparser.parse("4 bulan lalu")
datetime.datetime(2021, 3, 28, 20, 10, 43, 418255)           1 month ago -> incorrect
>>> dateparser.parse("4 bln lalu")
datetime.datetime(2020, 12, 28, 20, 10, 49, 97561)           4 months ago -> correct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: Bug - LanguageSubtype of bug, related to language data

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions