Validation for date fields works when either the whole date field or the "to" part of the field is set as "required", but when both are required an error shows up for the "to" field even when it is valid.

Setting the "to" field as required automatically sets the "from" field as required, but it should be possible to enforce "if one is set, then the other one should be set" without making the whole date field required.

CommentFileSizeAuthor
#2 date.module_todate.patch1.6 KBwflohr

Comments

agilpwc’s picture

I have the same error, in a from-to date. If the date is required and the 'to' date is required then an error is created when trying t submit a node. But if the 'to' date is not required then all is well.

wflohr’s picture

StatusFileSize
new1.6 KB

attached patch works for me

m3avrck’s picture

I have the same problem too seems like a reasonable fix :-)

NLMA’s picture

Version: 5.x-1.3 » 5.x-1.x-dev

I'm sorry, but I'm using the Date 5.x-1.x-dev version and this problem still exists. Patch wouldn't work too somehow. It could very well be me, but I'm not sure how to solve this.

wflohr’s picture

the patch just fixes the ... "but when both are required an error shows up for the "to" field even when it is valid."

applying the patch on the latest 5.x-1.x-dev download should work

patch -p0 < date.module_todate.patch

karens’s picture

Status: Active » Fixed

Sure enough, you're right. Fix committed to all branches. Thanks!

Anonymous’s picture

Status: Fixed » Closed (fixed)