Quicksketch,

My issue seems very similar to http://drupal.org/node/401954, and if it's a duplicate, I apologize.

I recently upgraded to the newest version and ran update.php, cleared caches.

I wanted to have the years in reverse chronological order, 2011, 2010, 2009, etc., up to 10 years prior.

I was to test the validation of the dates, and was given the message in the provided screenshot. One has the configuration for the range, starting 10 years in the past and going to 10 years in the future.

While attempting to submit a previous date, such as seen in the second screenshot, it would give the validation error.

I'm not using date popup, as you can see.

I was pretty sure this wasn't the case with 2.x, as I set up the form with the intention of this date range displaying the current year and all years previously, and hadn't had any users complain of not being able to validate the date.

Do I need to just use the textfield instead, and have users enter the year?

Comments

Title:Date range validation wants date from todayDate range validation wants month and date from today

I have this exact same problem. I originally had my dates -5 to -100 so the most recent years would appear on top, but now my users get a validation message saying they have to be WITHIN 5 years, not AT LEAST 5 years ago. I swapped the max and min to get the validation to work correctly, but now my year starts at 1911, not 2006.... and most of my users are teens...

Title:Date range validation wants month and date from todayUsing an end date that is before start date (to flip year order) no longer allowed

I think there are actually 2 issues being described here. The initial post with the screenshots is actually showing an error in which Webform is correct. If the start date is "-10 years" and the end date is "+10 years", you should get an error if your end-user date is more than 10 years ago. The screenshot shows a good example, the date entered was in May, but its currently September. So May 10 years ago is actually 10 years and 4 months ago. It should throw an error.

Although it's a bit awkward, you can solve this problem by using a Start Date of "Jan 1 - 10 years", meaning any date in all of 2001 will be allowed, even the days before the current one. Likewise your end date would need to be "Dec 31 + 10 years".

So the subject of this post (as well as the screenshots) show one problem. But the original post and comment #2 describe another problem, which does indeed seem to be broken behavior. If your end date is before your start date, it should flip the order of the "Year" drop down list (which it does correctly), but then the form won't let you submit. Instead of flipping start and end date, it actually validate the start date (which is actually later) as the start date and the end date as the end date. Looks like our validation just needs a fix.

Thanks for the clarification! I wasn't sure what was going on (obviously, since I was going back more than my date range..), but that definitely makes sense. Given what you've provided about defining specific start and end dates dates, I'm going to go try those out.

Referring back to the issue I had originally referenced as a similar/near duplicate issue, I noticed the patch that was included on the thread (http://drupal.org/files/issues/webform_reversible_dates.patch) and didn't see this in the code anywhere.

I'm not a programmer, but I didn't see anything related to this in the date.inc file anymore?

Version:6.x-3.14» 7.x-3.13

Updated to latest version and had start date of -18 and end date of -99 which worked before the update.
Now I changed it to '18 year ago' and '99 year ago' and it has problems validating.
It only works if I reverse the order and input '99 year ago' and '18 year ago'.

Is the 'bug' mentioned in #1 back?

Cheers

Is the 'bug' mentioned in #1 back?

Well it's not really "back", because it hasn't been fixed yet. That's why this issue is still in the "active" state. The bug exists in all versions higher than 3.12.

Status:Active» Fixed
StatusFileSize
new1.51 KB

I've committed this patch which fixes the validation to make it so that start and end dates can be flipped.

Thanx!

Status:Fixed» Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.