scrapinghub / dateparser

python parser for human readable dates

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

changing range of month

amirhosein-darmani opened this issue · comments

Hi, I want to search for dates in phrases but in Persian language which use Jalali calendar.
Because Jalali calendar does not work for searching longer chunks of texts, I changed the translation data in this format:
I changed the months name in gregorian calendar without changing the calendar from gregorian to Jalali.
I also change the relative_base date to the current time in Jalali calendar (again without changing the calendar from gregorian to Jalali).

Everything works well except that in Jalali calendar length of month differ from those on Gregorian calendar. For example February has 28,29 days in Gregorian but 'اردیبهشت' which is equal to Feb has 31 days in Jalali calendar.
How can I fix that?
Precisely, I want to change length of month in gregorian calendar in this format:
first 6 months (Jan to Jun): has 31 days
next 5 months (Jul to Nov): 30 days
Dec: 29 days

very kind regards for any help