No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    [q-input with q-date] I want date model as 'yyyy/mm/dd' but want to display as 'dd/mm/yyyy' in input box.

    Framework
    2
    4
    311
    Loading More Posts
    • 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.
    • J
      jitendra16 last edited by

      https://jsfiddle.net/h02bqgL6/

      1 Reply Last reply Reply Quote 0
      • s.molinari
        s.molinari last edited by

        Then you’ll need to transform the model between QDate and QInput yourself, as neither know what the day, month or year is.

        Scott

        J 1 Reply Last reply Reply Quote 0
        • J
          jitendra16 @s.molinari last edited by

          @s-molinari
          Do you mean that I need two date string?

            date: '2020/01/02',
            dateToDisplay: '02/01/2020'
          

          and use a transform function to convert each other

               this.dateDisplay = this.date.split('/').reverse().join('/')
               this.date= this.dateDisplay.split('/').reverse().join('/')
          
          
          1 Reply Last reply Reply Quote 0
          • s.molinari
            s.molinari last edited by

            Sorry, QDate can create formatted dates using the mask prop. But, if you need to reformat it for persistence purposes, then yeah. Something like that.

            Scott

            1 Reply Last reply Reply Quote 1
            • First post
              Last post