- Layout test fix
* kjs/DateMath.cpp:
(KJS::dateToDayInYear): accept and correctly handle negative months
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@16795
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2006-10-04 Kevin McCullough <KMcCullough@apple.com>
+
+ Reviewed by Adam.
+
+ - Layout test fix
+
+ * kjs/DateMath.cpp:
+ (KJS::dateToDayInYear): accept and correctly handle negative months
+
2006-10-05 Kevin McCullough <KMcCullough@apple.com>
build fix
static int dateToDayInYear(int year, int month, int day)
{
- year += static_cast<int>(floor(month / 12.0));
+ year += month / 12;
- month = static_cast<int>(fmod(month, 12.0));
- if (month < 0)
+ month %= 12;
+ if (month < 0) {
month += 12;
+ --year;
+ }
int yearday = static_cast<int>(floor(msFrom1970ToYear(year) / msPerDay));
int monthday = monthToDayInYear(month, isLeapYear(year));