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

    QRange how to use as date/time range selector with custom labels

    Framework
    2
    7
    388
    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

      I would like to use the QRange component to allow the user to select from variable time ranges (with variable steps), using milliseconds timestamps as the values of my min and max values of the date range. If I am just using the values (ie “1556010639162”) I can make the slider work between two of them, but I can’t find a way to format those values for label display (ie “April 23, 11am”, even if the underlying number is milliseconds)…is this even possible?

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

        I am looking for something similar to this (https://refreshless.com/nouislider/examples/#section-dates), but would prefer to use the native QRange component if possible. Anyone have any suggestions?

        1 Reply Last reply Reply Quote 0
        • M
          mKomo last edited by

          Hi,

          see: https://jsfiddle.net/udweq862/

          it needs some formatting but should be a start, you can take Date() object and format it as needed

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

            @mKomo Thanks!!

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

              @mKomo Thanks again, I have been playing around with it and it works pretty well, but ideally I would replace the labels on the slider handle circles themselves with the formatted date values. This seems like it might require a new feature request though, what do you think?

              Screenshot 2019-04-25 at 07.54.25.png

              1 Reply Last reply Reply Quote 0
              • M
                mKomo last edited by

                Hi, you can use the left-label-value and right-label-value props , you can make a computed property and bind it to the label

                See: https://jsfiddle.net/15c7qamu/3/

                again the date needs some formatting but it should work

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

                  Thanks SO much! I was misunderstanding the purpose of left label previously (thought it was about the entire range min, not the control label)

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