diff options
| author | Leyla Farazha <leyla@lindenlab.com> | 2010-01-05 15:57:09 -0800 |
|---|---|---|
| committer | Leyla Farazha <leyla@lindenlab.com> | 2010-01-05 15:57:09 -0800 |
| commit | ab3dbd647e78cff67ce7ffe85bb6fbc5c5461312 (patch) | |
| tree | c173a561457b6fb0195194cb21fa0d24c15e9589 /indra/newview/lldateutil.cpp | |
| parent | db6069e249b509e1551a76f438d795cbb9f992fa (diff) | |
| parent | cffe23df08bb0066c936efe667f60e90e0f89fd0 (diff) | |
Merge
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]; } } |
