如何验证 Php / Laravel 中的回历 (SH) 日期
How to validate Solar Hijri (SH) date In Php / Laravel
我的生日字段 form.and 类型是日期字符串(由日期选择器选择)。
我通过
验证此请求
'birthday'=>'required|date_format:"d/m/Y"|after:"01-01-1396"',
但是在太阳回历中我们有日期像 31/06/1396 并且验证器说不匹配 d/m/Y 而它说的是真的。
现在如何查看回历 (SH) 日期?
In Solar Hijri (SH) calendar
The first six months have 31 days, the next five have 30 days, and the
last month has 29 days in usual years but 30 days in leap years.
我现在使用这个正则表达式 但它不检查闰年
并且所有 12 个月可以是 30
这是 Y/m/d
'birthday'=>['required' ,'regex:/^\d{4}[\/\-]((0?[1-6])[\/\-](0?[1-9]|[12][0-9]|3[01])|(0?[7-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|30))$/']
我的生日字段 form.and 类型是日期字符串(由日期选择器选择)。 我通过
验证此请求'birthday'=>'required|date_format:"d/m/Y"|after:"01-01-1396"',
但是在太阳回历中我们有日期像 31/06/1396 并且验证器说不匹配 d/m/Y 而它说的是真的。
现在如何查看回历 (SH) 日期?
In Solar Hijri (SH) calendar The first six months have 31 days, the next five have 30 days, and the last month has 29 days in usual years but 30 days in leap years.
我现在使用这个正则表达式 但它不检查闰年 并且所有 12 个月可以是 30
这是 Y/m/d
'birthday'=>['required' ,'regex:/^\d{4}[\/\-]((0?[1-6])[\/\-](0?[1-9]|[12][0-9]|3[01])|(0?[7-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|30))$/']