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-date displayed date is incorrect from service value

    Help
    2
    3
    888
    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.
    • P
      peterPanParker last edited by peterPanParker

      Hi

      I have a service that returns 2 dates:

      start date: 2018-05-18
      end date: 2018-05-19

      q-date shows:

      start date: 2018-05-17
      end date: 2018-05-18

      my q-date definition looks like this:
      <q-field icon=“fas fa-calendar-alt” helper=“Fecha en la que iniciará a resolver el paquete”>
      <q-datetime v-model=“paquete.finicio” type=“date” format=“YYYY-MM-DD” placeholder=“Fecha de inicio” />
      </q-field>

      and the service value asignment like this:
      this.paquete.finicio = res.data.finicio; //date.formatDate(res.data.finicio, ‘YYYY-MM-DD’);

      anyone knows why could it be happening?

      thanks in advace…

      0_1526672121630_qdate.png

      1 Reply Last reply Reply Quote 0
      • J
        jeffatpf last edited by

        Most likely a UTC/Local time issue. There is no “time” component of the date set so most likely midnight (12 am) is used. If you don’t care about the time set the time component to noon time (12 pm) and you should be set.

        1 Reply Last reply Reply Quote 0
        • P
          peterPanParker last edited by peterPanParker

          Thanks, it works adding the time part… but in my humble opinion it shouldn’tbe that way because the control type is date and is not datetime, besides the documentation says:

          “The model (variable binded to v-model) must either be empty (undefined) or a string in the form of a valid ISO 8601 datetime value, like 2016-10-24T10:40:14.674Z. It can also be a shorter derivative of this string, like 2016-10-24 or 2016-10-24T10:40. The value can also be a Unix Timestamp (including milliseconds), like 1477298414674. Last but not least, it can also be an instance of the Javascript Date Object, like new Date().”

          Thanks again…

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