diff options
| author | Mark Palange (Mani) <palange@lindenlab.com> | 2010-02-02 14:45:42 -0800 |
|---|---|---|
| committer | Mark Palange (Mani) <palange@lindenlab.com> | 2010-02-02 14:45:42 -0800 |
| commit | 58f813a136a5a889e01b39e96714af91402321ba (patch) | |
| tree | e8bed3b7f40a322e576485e95396e2d00de745ca /indra/newview/lldateutil.cpp | |
| parent | 0f07ec0c692c94f60d9d834660362c4fc697bd1c (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]; } } |
