Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Qt quick : How to set calendar selectedDate in short format
Forum Updated to NodeBB v4.3 + New Features

Qt quick : How to set calendar selectedDate in short format

Scheduled Pinned Locked Moved Solved QML and Qt Quick
3 Posts 2 Posters 252 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.
  • M Offline
    M Offline
    Mohamad Ayrot
    wrote on last edited by
    #1

    i'am using Calendar qml type to set date but i can not get selectedData as mm.dd.yyyy.
    it shows the result as this with time : 12.12.2023 12:00:00 2023 GMT+0300

    this is the code:

            Calendar{
                id: calendar
                navigationBarVisible: true
                minimumDate: new Date()
    
                onPressed: {
                    timeInput = calendar.selectedDate
                    console.log(calendar.selectedDate)
                }
    
            }
    

    How can i get the short format ?

    ekkescornerE 1 Reply Last reply
    0
    • M Mohamad Ayrot

      i'am using Calendar qml type to set date but i can not get selectedData as mm.dd.yyyy.
      it shows the result as this with time : 12.12.2023 12:00:00 2023 GMT+0300

      this is the code:

              Calendar{
                  id: calendar
                  navigationBarVisible: true
                  minimumDate: new Date()
      
                  onPressed: {
                      timeInput = calendar.selectedDate
                      console.log(calendar.selectedDate)
                  }
      
              }
      

      How can i get the short format ?

      ekkescornerE Offline
      ekkescornerE Offline
      ekkescorner
      Qt Champions 2016
      wrote on last edited by
      #2

      @Mohamad-Ayrot take a look at Qt.formatDate
      https://doc.qt.io/qt-6/qml-qtqml-qt.html#formatDate-method

      ekke ... Qt Champion 2016 | 2024 ... mobile business apps
      5.15 --> 6.9 https://t1p.de/ekkeChecklist
      QMake --> CMake https://t1p.de/ekkeCMakeMobileApps

      1 Reply Last reply
      2
      • M Offline
        M Offline
        Mohamad Ayrot
        wrote on last edited by
        #3

        Thank You

        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