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

    [v1] Problem with QDate and QTime and rules

    Help
    1
    1
    383
    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.
    • B
      bazzou789 last edited by bazzou789

      I have a QInput with a QDate and a QTime to process a datetime. I have a Regex that works when I type directly in the input and when I select a time, but whe I change the date with the QDate, my rules are triggered and it says that I didn’t select a good format, but my model is good.

      Do I do something wrong ?

      <q-input
                :label="$t('todo.dueDate')"
                filled
                v-model="todo.dueDate"
                mask="datetime"
                :rules="[val => $regexes.datetime.test(val) || $t('validations.datetime')]"
              >
                <template v-slot:prepend>
                  <q-icon name="event" class="cursor-pointer">
                    <q-popup-proxy ref="qDateProxy" transition-show="scale" transition-hide="scale">
                      <q-date v-model="todo.dueDate" mask="YYYY/MM/DD HH:mm" @input="() => $refs.qDateProxy.hide()" />
                    </q-popup-proxy>
                  </q-icon>
                </template>
      
                <template v-slot:append>
                  <q-icon name="access_time" class="cursor-pointer">
                    <q-popup-proxy ref="qTimeProxy" transition-show="scale" transition-hide="scale">
                      <q-time v-model="todo.dueDate" mask="YYYY/MM/DD HH:mm" format24h @input="() => $refs.qTimeProxy.hide()" />
                    </q-popup-proxy>
                  </q-icon>
                </template>
              </q-input>
      
      1 Reply Last reply Reply Quote 0
      • First post
        Last post