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

Date format Locale.ShortFormat returns different results as described in documentation.

    XMLWordPrintable

Details

    • 864f9b79fba25b38a1139d67a7b299b63149c470 (qt/qtdeclarative/dev) beea6c18f0b6050e4d2633fba462f2b9b67ab134 (qt/qtdeclarative/5.15)

    Description

      Format Locale.ShortFormat returns for "28-04-2020" and and Locale.LongFormat "dinsdag 28 april 2020" when used with "nl_NL" .

      The documentation(https://doc.qt.io/qt-5/qml-qtqml-date.html#details) describes following:

      Locale.LongFormat The long version of the string; for example, returning "January" as a month name.
      Locale.ShortFormat The short version of the string; for example, returning "Jan" as a month name.

       Is the Locale.ShortFormat correct or is the documentation false?

       Here is the example QML:

      import QtQuick 2.12
      import QtQuick.Window 2.12
      
      Window {
          visible: true
          width: 640
          height: 480
          title: qsTr("Hello World")
          Text {
              text: "The date is: " + new Date().toLocaleDateString(Qt.locale("nl_NL"),Locale.ShortFormat)
          }
      }
      

      Attachments

        For Gerrit Dashboard: QTBUG-83841
        # Subject Branch Project Status CR V

        Activity

          People

            kkohne Kai Köhne
            tero.pelkonen Tero Pelkonen
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes