[SOLVED] Formatting issues with q-date
I store my dates in js millisecond format, and I want to format these for use with Qdate using a mask of
DD/MM/YYYYbut can’t get it to work.
Here is a codepen demonstrating the problems:
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.
Is this perhaps a bug in the mask prop of the component? Is anyone else using this mask or milliseconds as a base?
@ssuess Line 15
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
valueis the British format.
const correct_date = Quasar.utils.date.extractDate(value, 'DD/MM/YYYY');
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…
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).
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)
This post is deleted!
Solved by adding