You don’t need the date
validator. It doesn’t support dd/mm/yyyy format, and that’s why you are getting “Please enter a valid date” message for input like 13/01/2014. You already have the dateITA
validator, which uses dd/mm/yyyy format as you need.
Just like the date
validator, your code for dateGreaterThan
and dateLessThan
calls new Date
for input string and has the same issue parsing dates. You can use a function like this to parse the date:
function parseDMY(value) { var date = value.split("/"); var d = parseInt(date[0], 10), m = parseInt(date[1], 10), y = parseInt(date[2], 10); return new Date(y, m - 1, d); }
Related Posts:
- Convert normal date to unix timestamp
- Compare two dates with JavaScript
- Add days to JavaScript Date
- Add days to JavaScript Date
- Moment js date time comparison
- How to validate date with format “mm/dd/yyyy” in JavaScript?
- Convert UTC date time to local date time
- What is jQuery Unobtrusive Validation?
- Check time difference in Javascript
- How do I redirect to another webpage?
- How to format a JavaScript date
- Uncaught ReferenceError: jQuery is not defined [duplicate]
- How do I check whether a checkbox is checked in jQuery?
- JQuery – $ is not defined
- Cannot read property ‘push’ of undefined when combining arrays
- Download File Using JavaScript/jQuery
- Disabling and enabling a html input button
- Check if checkbox is checked with jQuery
- How to import jquery using ES6 syntax?
- How to filter an array/object by checking multiple values
- Uncaught SyntaxError: Invalid or unexpected token
- Infinite Scrolling in Asp.Net MVC with jQuery / AJAX Issues
- What are the difference between $(document).bind(‘ready’, function) and $(document).ready(function() {})
- How to use php code in javascript
- Adding images to a Bootstrap Carousel with AJAX
- How to read xml file contents in jQuery and display in html elements?
- How can I print using JQuery
- Format JavaScript date as yyyy-mm-dd
- Unable to preventDefault inside passive event listener
- jQuery $.cookie is not a function
- Setting background-image using jQuery CSS property
- How do I get the current time only in JavaScript
- Uncaught TypeError: Cannot read property ‘msie’ of undefined – jQuery tools
- Scroll Automatically to the Bottom of the Page
- How do I check if string contains substring?
- How to subtract date/time in JavaScript?
- How can I select an element by name with jQuery?
- jQuery disable/enable submit button
- Equivalent of jQuery .hide() to set visibility: hidden
- How can I get the last character in a string?
- Shortest way to print current year in a website
- Uncaught TypeError: Cannot read property ‘name’ of undefined
- How to calculate date difference in JavaScript?
- Dynamically load JS inside JS
- How can I check if a string is a valid number?
- Simulate Keypress With jQuery
- How to add an object to an array
- jQuery Ajax POST example with PHP
- Setting and getting localStorage with jQuery
- How to subtract days from a plain Date?
- this vs $(this)
- Javascript isnull
- Set value to currency in
- How to add 30 minutes to a JavaScript Date object?
- How to open a URL in a new Tab using JavaScript or jQuery?
- How to sort an object array by date property?
- SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
- HTML Entity Decode
- Extract hostname name from string
- jquery beforeunload when closing (not leaving) the page?
- how to get the value of a textarea in jquery?
- How do I pass the this context to a function?
- Escaping HTML strings with jQuery
- How to use z-index in svg elements?
- Why define an anonymous function and pass it jQuery as the argument?
- How to scroll an HTML page to a given anchor
- What is the best way to detect a mobile device?
- How to filter JSON Data in JavaScript or jQuery?
- Get querystring from URL using jQuery [duplicate]
- jQuery checkbox change and click event
- jQuery selectors on custom data attributes using HTML5
- How do I refresh a DIV content?
- TypeError: abc.getAttribute is not a function
- jQuery sort elements using data id
- How to fire an event on class change using jQuery?
- Uncaught SyntaxError: Unexpected token with JSON.parse
- TypeError getElementsByTagName is not a function issue
- How to check if the URL contains a given string?
- Check if url contains string with JQuery
- jquery to validate phone number
- Closing Bootstrap modal onclick
- stopPropagation vs. stopImmediatePropagation
- What’s a Good Javascript Time Picker?
- Ajax success function
- How can I exit from a javascript function? [duplicate]
- Cannot read property ‘preventDefault’ of undefined in javascript error
- Object doesn’t support property or method ‘addEventListener’
- How to fix javascript .toFixed is not a Function error
- jQuery checkbox checked state changed event
- etect the Enter key in a text input field
- WordPress 5.5 – ReferenceError: commonL10n is not defined error
- Jquery function working in Chrome Console but not in the code [closed]
- How to set callback to execute after all the tinyMCE editors have been initialized?
- How do I make my wordpress post appear in a mouse hover preview?
- Required radio button does not validate in form, when clicked through Javascript/jQuery
- Change each text after 4 second and each image after 2 second
- wp post_tag change minlength
- How to locate the js code and php code for certain function?
- Use one javascript variable into another javascript file
- Uncaught ReferenceError: tippy is not defined