Closed mheidari988 closed 2 years ago
System.ArgumentOutOfRangeException: Specified time is not supported in this calendar. It should be between 0001/1/1 0:00:00 (Gregorian date) and 9378/10/13 23:59:59 (Gregorian date), inclusive. (Parameter 'time') Actual value was 0.
Hi
Please check the datetime
properties in your model.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
It's because negative values are not supported in DateTime. 0001/01/01 (Default DateTime) in Gregorian Calendar will map to a negative year in Persian Calendar. I'm almost 100% sure that there are better ways to Handle this issue. but here is a quick fix just use new CultureInfo("fa-ir").Calendar.MinSupportedDateTime;
instead of default
or DateTime.Min
+ initialize datetime values to corresponding value of MinSupportedDateTime for your calendar (in our case Persian Calendar) and you should be fine.
First I Added
fa
localization by usingabp translate -c fa
which generatedjson
file to translate. Then after full translation and usingabp translate -a
command, the application hadfa
language in the menu. When I changed the language to thefarsi
and tried to open the CreateModal page, the application throws the exception.Note that there is not any exception in other languages.
This occurs when