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

    [SOLVED] Formatting issues with q-date

    Framework
    2
    8
    1427
    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.
    • ssuess
      ssuess last edited by ssuess

      I store my dates in js millisecond format, and I want to format these for use with Qdate using a mask of DD/MM/YYYY but can’t get it to work.

      Here is a codepen demonstrating the problems:

      https://codepen.io/ssuess/pen/GRZLajP

      I can’t type a date into the field (it changes and jumps around separate from my entry), and it is not allowing calendar selection either in the popup.

      1 Reply Last reply Reply Quote 0
      • ssuess
        ssuess last edited by

        Is this perhaps a bug in the mask prop of the component? Is anyone else using this mask or milliseconds as a base?

        1 Reply Last reply Reply Quote 0
        • T
          turigeza last edited by turigeza

          @ssuess Line 15 console.log(Quasar.utils.date.formatDate(value, 'x'))

          Logs undefined. But only for certain dates! So there must be something wrong with that line.

          Most likely formatDate expecting the American date format and here value is the British format.

          Update:
          https://codepen.io/turigeza/pen/yLOWYWx

          const correct_date = Quasar.utils.date.extractDate(value, 'DD/MM/YYYY');

          1 Reply Last reply Reply Quote 1
          • ssuess
            ssuess last edited by

            The thing is, ‘x’ should be a valid format for milliseconds as described here: https://quasar.dev/quasar-utils/date-utils#Format-for-display. So I wonder if this is a bug or something else is going on…I will look at your codepen thanks for the reply…

            1 Reply Last reply Reply Quote 0
            • ssuess
              ssuess last edited by

              I checked it out, and although you have solved the problem of selecting an item on the calendar popup, trying to hand type a date in the field is still impossible, and I don’t understand why (unless this is a bug).

              1 Reply Last reply Reply Quote 0
              • ssuess
                ssuess last edited by

                Ok, unless anyone has a solution for this (being unable to hand type a date in the input field as opposed to using the popup to select one) I guess I will report this as a bug in github. (updated codepen here: https://codepen.io/ssuess/pen/GRZLajP)

                1 Reply Last reply Reply Quote 0
                • ssuess
                  ssuess last edited by ssuess

                  This post is deleted!
                  1 Reply Last reply Reply Quote 0
                  • ssuess
                    ssuess last edited by ssuess

                    Solved by adding debounce parameter.

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