Closed Moeinoddin-Mansourfar closed 3 months ago
Thanks for letting me know about the issue! I’ve added the fromisoformat method to JalaliDateTime, so it now correctly handles both date and time from ISO 8601 strings. Just update to the latest version.
from persiantools.jdatetime import JalaliDateTime
# Convert ISO format string to JalaliDateTime
jdt = JalaliDateTime.fromisoformat('1403-08-09T02:21:45')
print(jdt) # Outputs: JalaliDateTime(1403, 8, 9, 2, 21, 45)
# Round trip back to ISO format
iso_str = jdt.isoformat()
print(iso_str) # Outputs: '1403-08-09T02:21:45'
the method .fromisoformat in JalaliDateTime ignores the time and only parses the date component: