Below is a codepen with a simple input field for entering dates:
<input type="text"
v-model="startDate"
name="StartDate"
v-validate="{ required: false, date_format: 'dd/MM/yyyy', before: maxStartDate }"/>
Despite entering a valid date, an error message keeps appearing:
The StartDate must be before 2019-08-01T03:59:59.999Z.
I've attempted the following solutions:
- Returning JavaScript date objects and ISO dates as maxStartDate values.
- Trying different combinations of validation rules such as removing date_format or required.
- This issue has consumed hours of my time. It seems like I'm overlooking something obvious and will soon figure it out.
I also noticed that vee-validate uses UK-style locales in its messages. Despite being in the US, dates are displayed as 25/07/2019 which might be affecting date comparisons.
Codepen link: https://codepen.io/Kinetiq/pen/XLeEaM