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

    Bug formatDate

    Help
    3
    5
    96
    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.
    • D
      DouglasCalora last edited by

      When I send a date like “date.formatDate(‘2019/05/05’, ‘DD/MM/YYYY’)” it returns “05/05/2019”. But when I send date.formatDate(‘2019-05-05’, ‘DD/MM/YYYY’) it returns “04/05/2019”. Why is that happen?

      metalsadman 1 Reply Last reply Reply Quote 0
      • B
        BabaYaga last edited by

        Why would it return 04/05 if you pass it 05-05? Are you sure you’re passing it 05-05?

        1 Reply Last reply Reply Quote 0
        • metalsadman
          metalsadman @DouglasCalora last edited by metalsadman

          @DouglasCalora it’s not a bug, you are passing a string, formatDate expecting params (Date object, String format). in your case you can do something like date.formatDate(new Date(‘2019-05-05’), ‘DD/MM/YYYY’).

          D 1 Reply Last reply Reply Quote 0
          • D
            DouglasCalora @metalsadman last edited by

            @metalsadman I’ve already tried pass a “New Date()” and didn’t work, I resolved with “new Date(value).toISOString().slice(0, 23)”

            metalsadman 1 Reply Last reply Reply Quote 0
            • metalsadman
              metalsadman @DouglasCalora last edited by

              @DouglasCalora https://codepen.io/metalsadman/pen/qBEZgOx?&editable=true&editors=101

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