Ignore:
Timestamp:
Jul 23, 2012, 10:19:55 PM (13 years ago)
Author:
Patrick Gansterer
Message:

Move GregorianDateTime from JSC to WTF namespace
https://bugs.webkit.org/show_bug.cgi?id=91948

Reviewed by Geoffrey Garen.

Moving GregorianDateTime into the WTF namespace allows us to us to
use it in WebCore too. The new class has the same behaviour as the
old struct. Only the unused timeZone member has been removed.

Source/JavaScriptCore:

  • runtime/DateConstructor.cpp:
  • runtime/DateConversion.cpp:
  • runtime/DateConversion.h:
  • runtime/DateInstance.h:
  • runtime/DatePrototype.cpp:
  • runtime/JSDateMath.cpp:
  • runtime/JSDateMath.h:

Source/WebCore:

  • bridge/qt/qt_runtime.cpp:

(JSC::Bindings::convertValueToQVariant):
(JSC::Bindings::convertQVariantToValue):

  • bridge/qt/qt_runtime_qt4.cpp:

(JSC::Bindings::convertValueToQVariant):
(JSC::Bindings::convertQVariantToValue):

Source/WTF:

  • GNUmakefile.list.am:
  • WTF.gypi:
  • WTF.pro:
  • WTF.vcproj/WTF.vcproj:
  • WTF.xcodeproj/project.pbxproj:
  • wtf/CMakeLists.txt:
  • wtf/GregorianDateTime.h: Added.

(GregorianDateTime):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/DateConversion.cpp

    r123376 r123425  
    5959{
    6060    snprintf(buffer, DateConversionBufferSize, "%s %s %02d %04d",
    61         weekdayName[(t.weekDay + 6) % 7],
    62         monthName[t.month], t.monthDay, t.year + 1900);
     61        weekdayName[(t.weekDay() + 6) % 7],
     62        monthName[t.month()], t.monthDay(), t.year() + 1900);
    6363}
    6464
     
    6666{
    6767    snprintf(buffer, DateConversionBufferSize, "%s, %02d %s %04d",
    68         weekdayName[(t.weekDay + 6) % 7],
    69         t.monthDay, monthName[t.month], t.year + 1900);
     68        weekdayName[(t.weekDay() + 6) % 7],
     69        t.monthDay(), monthName[t.month()], t.year() + 1900);
    7070}
    7171
    7272void formatTime(const GregorianDateTime &t, DateConversionBuffer& buffer)
    7373{
    74     int offset = abs(gmtoffset(t));
     74    int offset = abs(t.utcOffset());
    7575    char timeZoneName[70];
    7676    struct tm gtm = t;
     
    7979    if (timeZoneName[0]) {
    8080        snprintf(buffer, DateConversionBufferSize, "%02d:%02d:%02d GMT%c%02d%02d (%s)",
    81             t.hour, t.minute, t.second,
    82             gmtoffset(t) < 0 ? '-' : '+', offset / (60*60), (offset / 60) % 60, timeZoneName);
     81            t.hour(), t.minute(), t.second(),
     82            t.utcOffset() < 0 ? '-' : '+', offset / (60*60), (offset / 60) % 60, timeZoneName);
    8383    } else {
    8484        snprintf(buffer, DateConversionBufferSize, "%02d:%02d:%02d GMT%c%02d%02d",
    85             t.hour, t.minute, t.second,
    86             gmtoffset(t) < 0 ? '-' : '+', offset / (60*60), (offset / 60) % 60);
     85            t.hour(), t.minute(), t.second(),
     86            t.utcOffset() < 0 ? '-' : '+', offset / (60*60), (offset / 60) % 60);
    8787    }
    8888}
     
    9090void formatTimeUTC(const GregorianDateTime &t, DateConversionBuffer& buffer)
    9191{
    92     snprintf(buffer, DateConversionBufferSize, "%02d:%02d:%02d GMT", t.hour, t.minute, t.second);
     92    snprintf(buffer, DateConversionBufferSize, "%02d:%02d:%02d GMT", t.hour(), t.minute(), t.second());
    9393}
    9494
Note: See TracChangeset for help on using the changeset viewer.