Changeset 16795 in webkit for trunk/JavaScriptCore


Ignore:
Timestamp:
Oct 4, 2006, 5:19:21 PM (19 years ago)
Author:
kmccullo
Message:

Reviewed by Adam.

  • Layout test fix
  • kjs/DateMath.cpp: (KJS::dateToDayInYear): accept and correctly handle negative months
Location:
trunk/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r16793 r16795  
     12006-10-04  Kevin McCullough  <[email protected]>
     2
     3        Reviewed by Adam.
     4
     5        - Layout test fix
     6
     7        * kjs/DateMath.cpp:
     8        (KJS::dateToDayInYear): accept and correctly handle negative months
     9
    1102006-10-05  Kevin McCullough  <[email protected]>
    211
  • trunk/JavaScriptCore/kjs/DateMath.cpp

    r16793 r16795  
    278278static int dateToDayInYear(int year, int month, int day)
    279279{
    280     year += static_cast<int>(floor(month / 12.0));
    281 
    282     month = static_cast<int>(fmod(month, 12.0));
    283     if (month < 0)
     280    year += month / 12;
     281
     282    month %= 12;
     283    if (month < 0) {
    284284        month += 12;
     285        --year;
     286    }
    285287
    286288    int yearday = static_cast<int>(floor(msFrom1970ToYear(year) / msPerDay));
Note: See TracChangeset for help on using the changeset viewer.