Bold BI®Unlock stunning dashboards with Bold BI®: 35+ widgets, 150+ data sources, AI agent & more. Try it for free!
Hello,
As you can see at https://stackblitz.com/edit/react-6hwrdehg?file=App.js the formValidator will not validate a date with DD/MM/YYYY format. It will work with MM/DD/YYYY. I have assigned 'el' to the formValidator's locale, but it still won't work.
Hi George,
Thank you for reaching out to us.
The issue arises because the FormValidator does not inherently support the dd/MM/yyyy
date format for validation even when you specify the locale. By default, the validation expects a date format like MM/dd/yyyy
. Since you are using the dd/MM/yyyy
format, you need to define a custom validation method to ensure the date is validated correctly.
You can define a custom function that validates the date format as dd/MM/yyyy
using a regular expression or JavaScript's Date
parsing capabilities.
Update the validation options and add a custom rule:
import { useState, useEffect, useRef } from 'react';
let formObject;
function App() {
const dateChangeHandler = (event) => {
useEffect(() => {
function validateCustomDate(args) {
// Initialize the form validator
const onSubmit = () => {
return (
export default App; |
Sample: https://stackblitz.com/edit/react-6hwrdehg-ydx3wkzx?file=App.js
Regards,
Priyanka K
Thank you for providing a solution. I'll implement it when able and report back if needed,
Hi George,
Thank you for the update. Please get back to us if you need any further assistance.
Regards,
Priyanka K