Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
There is an issue in clientside_validation.js @ line 1193
If today is "January, 30", the line:
var date = new Date();
Is in effect the same as:
var date = new Date(2013, 0, 30);
If we validate the date: "February, 15", consider this code:
// February is equal to 1 in javascript, so month = 1
date.setMonth(month); // we are doing date.setMonth(1);
// Date was "January, 30", we set it as "February, 30", but this makes the date "March, 2" !
if (month !== date.getMonth()) { // fails because: 1 !== 2
result = false;
Comment | File | Size | Author |
---|---|---|---|
#1 | day-in-month-overflow-1902840-1.diff | 478 bytes | MiroslavBanov |
Comments
Comment #1
MiroslavBanov CreditAttribution: MiroslavBanov commentedSubmitting my patch for issue
Comment #2
kpaxman CreditAttribution: kpaxman commentedI confirm this fixes the issue for me.
Comment #3
attiks CreditAttribution: attiks commentedI somehow missed this, but this should be fixed in the mean time in the latest dev version, if not feel free to re-open.
Comment #4.0
(not verified) CreditAttribution: commentedClarify some points. Nothing is changed - just a better explanation.