fixes bug #395
month 0 is January year 0 is 1900 git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16992 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
f51fb4696c
commit
52f8cb492d
@ -6,17 +6,15 @@
|
||||
bool
|
||||
isLeapYear(const int year)
|
||||
{
|
||||
if ((year % 400 == 0)||(year % 4 == 0 && year % 100 == 0))
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
int realYear = year + 1900;
|
||||
return ((realYear % 400 == 0)||(realYear % 4 == 0 && realYear % 100 != 0));
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
getDaysInMonth(const int month, const int year)
|
||||
{
|
||||
if (month == 2 && isLeapYear(year)) {
|
||||
if (month == 1 && isLeapYear(year)) {
|
||||
return 29;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user