diff options
author | Ychebotarev ProductEngine <ychebotarev@productengine.com> | 2010-01-11 15:09:23 +0200 |
---|---|---|
committer | Ychebotarev ProductEngine <ychebotarev@productengine.com> | 2010-01-11 15:09:23 +0200 |
commit | 31c5c18f6c1325060fa3ea3fb2253168fd98adda (patch) | |
tree | 137927cad5301959cb7b1f3c026b0c873676686f /indra/newview/lldateutil.cpp | |
parent | 4a902dd76ae1bbf2e080632ebb51896ed6f007b3 (diff) | |
parent | d0c029c6094bf23ad9a016d9029b830d674a566a (diff) |
merge
--HG--
branch : product-engine
Diffstat (limited to 'indra/newview/lldateutil.cpp')
-rw-r--r-- | indra/newview/lldateutil.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/indra/newview/lldateutil.cpp b/indra/newview/lldateutil.cpp index 10b7935caf..abb2fdeb9a 100644 --- a/indra/newview/lldateutil.cpp +++ b/indra/newview/lldateutil.cpp @@ -44,15 +44,18 @@ static S32 DAYS_PER_MONTH_LEAP[] = static S32 days_from_month(S32 year, S32 month) { + llassert_always(1 <= month); + llassert_always(month <= 12); + if (year % 4 == 0 && year % 100 != 0) { // leap year - return DAYS_PER_MONTH_LEAP[month]; + return DAYS_PER_MONTH_LEAP[month - 1]; } else { - return DAYS_PER_MONTH_NOLEAP[month]; + return DAYS_PER_MONTH_NOLEAP[month - 1]; } } |