Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Locale Short and Narrow same format
Qt 6.11 is out! See what's new in the release blog

Locale Short and Narrow same format

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 680 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    DJung
    wrote on last edited by
    #1

    Hi,

    I'm using Qt Locale in one of my js functions but I'm getting the same format for ShortFormat and LongFormat.

    I've tried testing it using

    console.log(Qt.locale("en-US").dateFormat(Locale.NarrowFormat));
    console.log(Qt.locale("en-US").dateFormat(Locale.ShortFormat));
    console.log(Qt.locale("en-US").dateFormat(Locale.LongFormat));

    and i get the output

    M/d/yy
    M/d/yy
    dddd, MMMM d, yyyy

    Is there a reason it yields the same format?
    (I've also tried in different languages)

    Thanks

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      Do you mean Short and Narrow ? If so, they can have the same value. See QLocale::FormatType

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved