Welcome Guest, Not a member yet? Register   Sign In
valid_date[d/m/Y] doesn't validate year properly
#1

(This post was last modified: 03-27-2022, 02:54 PM by androsfat.)

I am trying to validate a date field using validation rules
Code:
'date' => 'required|valid_date[d/m/Y]'
and it accepts as a year any integer value. It can be from 0 until 9999.
Shouldn't it be according to "Y" validation of a full year like 1995 or 2022?
Reply
#2

Year 0 and Year 9999 are valid year.
Reply
#3

Thanks, I agree with that.
Any suggestions how to limit the year to let's say 2000?
Unless I create my own custom date validation.
Reply
#4

Didn't look at it closely but it would be trivial to implement a custom validation method. You can check the documentation for an example.
Practical guide to IgnitedCMS - Book coming soon, www.ignitedcms.com
Reply




Theme © iAndrew 2016 - Forum software by © MyBB