ashkang / jcal

Jalali Calendar Library
http://nongnu.org/jcal
139 stars 24 forks source link

jalali_update() must normalize according to POSIX specifications #10

Closed ashkang closed 10 years ago

ashkang commented 10 years ago

The original values of tm_wday and tm_yday components of the structure must be ignored. The original values of other components are not restricted to their normal ranges and must be normalized, if need be. For example, Favardin 40 must change into Ordibehesht 9, a tm_hour of -1 means 1 hour before midnight, tm_mday of 0 means the day preceding the current month, and tm_mon of -2 means 2 months before Farvardin of tm_year.

reith commented 10 years ago

Provided pull request do normalization in jalali_update, but jmktime should use it too.