Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-70516

Extend Qt's support for CLDR date/time formatting

    XMLWordPrintable

Details

    • Task
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.0.0, 5.12
    • None
    • All

    Description

      CLDR's date field symbol table has a significantly richer range of ways to format dates and times than QLocale, Q(Date|Time)+ and friends.

      For example, we ignore the 'v' token for the "short generic non-location" form of a time-zone (we don't produce any zone indicator in its place) and pass the 'S' token, for "Fractional Second" (we should map it to our 'z' token; this is an easy fix I've already coded), through unconverted as a literal. We likewise pass through the 'VV' token for "The long time zone ID" (e.g. "Europe/Berlin") as a literal, which is a particular pity as it's the form we'd actually be able to parse robustly (there is no guarantee that the one time-zone specifier we do support - the "short specific non-location" from, e.g. CET - is a unique identifier; several zones might abbreviate identically). We also mishandle 'E'-based tokens (inter alia, up to three should map to our 'ddd' format, but we only recognise 'EEE' for this; this I can fix cheaply).

      Relevant Qt source:

      • the mapping from CLDR's formats to Qt's is performed by convertFormat() in qtbase/util/local_database/localexml.py
      • parsing of our format is done by QDateTimeParser::parseFormat() and QLocalePrivate::dateTimeToString()

      Significant reworking of QLocale, Q(Date|Time)+ and friends shall be required to support this; in many cases we don't have suitable data (for example, the omission of 'v' is surely because we don't have cross-platform consistent information about time-zone names).

      Attachments

        Issue Links

          Activity

            People

              Eddy Edward Welbourne
              Eddy Edward Welbourne
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - 4 weeks
                  4w
                  Remaining:
                  Remaining Estimate - 4 weeks
                  4w
                  Logged:
                  Time Spent - Not Specified
                  Not Specified