Changeset 130244 in webkit


Ignore:
Timestamp:
Oct 2, 2012 6:38:25 PM (11 years ago)
Author:
tkent@chromium.org
Message:

Implement LocaleICU::dateFormat
https://bugs.webkit.org/show_bug.cgi?id=98118

Reviewed by Hajime Morita.

http://trac.webkit.org/changeset/130127 introduced
Localizer::dateFormat, and this is its implementation for LocaleICU
classs. The code is going to be used when
ENABLE_INPUT_MULTIPLE_FIELDS_UI is enabled.

No new tests. The function is not used yet.

  • platform/text/LocaleICU.cpp:

(WebCore::LocaleICU::dateFormat):
Implemented. Note that m_shortDateFormat is a UDateFormat object, which
knows various format information.

  • platform/text/LocaleICU.h:

(LocaleICU): Add m_dateFormat to cache the format string.

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r130243 r130244  
     12012-10-02  Kent Tamura  <tkent@chromium.org>
     2
     3        Implement LocaleICU::dateFormat
     4        https://bugs.webkit.org/show_bug.cgi?id=98118
     5
     6        Reviewed by Hajime Morita.
     7
     8        http://trac.webkit.org/changeset/130127 introduced
     9        Localizer::dateFormat, and this is its implementation for LocaleICU
     10        classs. The code is going to be used when
     11        ENABLE_INPUT_MULTIPLE_FIELDS_UI is enabled.
     12
     13        No new tests. The function is not used yet.
     14
     15        * platform/text/LocaleICU.cpp:
     16        (WebCore::LocaleICU::dateFormat):
     17        Implemented. Note that m_shortDateFormat is a UDateFormat object, which
     18        knows various format information.
     19        * platform/text/LocaleICU.h:
     20        (LocaleICU): Add m_dateFormat to cache the format string.
     21
    1222012-10-02  Kent Tamura  <tkent@chromium.org>
    223
  • trunk/Source/WebCore/platform/text/LocaleICU.cpp

    r130127 r130244  
    414414String LocaleICU::dateFormat()
    415415{
    416     // FIXME: We should have real implementation of LocaleICU::dateFormat().
    417     return emptyString();
     416    if (!m_dateFormat.isEmpty())
     417        return m_dateFormat;
     418    if (!initializeShortDateFormat())
     419        return ASCIILiteral("dd/MM/yyyy");
     420    m_dateFormat = getDateFormatPattern(m_shortDateFormat);
     421    return m_dateFormat;
    418422}
    419423
  • trunk/Source/WebCore/platform/text/LocaleICU.h

    r130127 r130244  
    109109
    110110#if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
     111    String m_dateFormat;
    111112    UDateFormat* m_mediumTimeFormat;
    112113    UDateFormat* m_shortTimeFormat;
Note: See TracChangeset for help on using the changeset viewer.