Hi,

I am creating a "week commencing" field and need to validate that the date (date module) is a Monday..

Looking at "Date range2" rules but can't see how to specify it..

Any help appreciated.. Thanks..

Comments

g089h515r806’s picture

Cycle : week
min: 1 01:01:01
max: 1 23:59:59

wipeout_dude’s picture

Thanks for replying..

Your suggestion didn't seem to work..

I tried..

Cycle : week
min: 1 00:00:00
max: 1 23:59:59

..as well which also didn't work..

The field is only a date, no hours, minutes or seconds.. Would that make a difference??

Is "Date range" and "Date range2" pretty much the same thing just with a different UI??

g089h515r806’s picture

"Date range" and "Date range2" should have the same thing .
I have not test all the use case when i build "Date range2" ,
You could try with "Date range" .

the correct should be :
Cycle : week
min: 1 00:00:01
max: 1 23:59:59

g089h515r806’s picture

Status: Active » Reviewed & tested by the community

Try with the latest code of dev version.
I have fixed it.
The correct code for week validate should be:

              $week_day = date('w', strtotime($date_str));
              $date_str = substr($date_str, 10);
wipeout_dude’s picture

The dev version appear to solve the date validation.. Also created a rule to validate monday - friday whick worked..

Thanks..

g089h515r806’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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