We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 86c9d65 commit 593ac61Copy full SHA for 593ac61
pythainlp/util/thai_lunar_date.py
@@ -358,10 +358,8 @@ def to_lunar_date(input_date: date) -> str:
358
day_from_one = r_day_prev + day_of_year + 1
359
last_day = last_day_in_year(input_date.year)
360
361
- if last_day == 354: # Normal year
362
- days_in_month = _DAYS_NORMAL[:13]
363
- elif last_day == 355: # Normal year
364
- days_in_month = _DAYS_NORMAL[:14]
+ if last_day <= 355: # Normal year
+ days_in_month = _DAYS_NORMAL
365
elif last_day == 384: # Leap year
366
days_in_month = _DAYS_LEAP
367
0 commit comments