slashmili / python-jalali

Jalali calendar binding for Python based on Python's datetime module
http://pypi.python.org/pypi/jdatetime/
Other
335 stars 46 forks source link

Error: "day out of month" when using `datetime.fromisoformat` with valid date #145

Closed zareshahi closed 10 months ago

zareshahi commented 10 months ago

Description: I encountered an issue when using the jdatetime library's datetime.fromisoformat method to create a jdatetime datetime object from a valid ISO format date string. The library is raising an exception with the message "day out of month," even though the date appears to be valid.

Environment:

Steps to Reproduce:

  1. Import the jdatetime library.
  2. Attempt to create a jdatetime datetime object using the fromisoformat method with a valid ISO format date string.
import jdatetime
date_string = '2023-07-31T12:13:22+00:00'
try:
    dt = jdatetime.datetime.fromisoformat(date_string)
except Exception as e:
    print(f"Error: {e}")

Expected Behavior: The fromisoformat method should successfully create a jdatetime datetime object from the provided ISO format date string without raising an exception.

Actual Behavior: An exception with the message "day out of month" is raised.

5j9 commented 10 months ago

Duplicate of #143, see my comment there.

hramezani commented 10 months ago

Thanks @5j9