alleyinteractive / alleyinteractive/wordpress-fieldmanager

Validation of date fields

Đang mở
#581 3 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
PHP
Star
563
Fork
99
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

Hello!
I have managed to find a way to get the minimum_count function working to force the number of fields not to go below the minimum. I have forked the code and modified the unit tests to match the new assertions required.

My problem and question is now, how to validate date fields? It seems obvious that validation is not supported because the date field has more than one text input. I know from my browser console that the "name" attribute array indexes used in the Date field are "date," "hour," and "minute." With that in mind, I have an idea of adding validation by adding an extra "layer" around what is put. What goes into the $required, $validate, $validation_rules, and $validation_messages properties for other field types should work for Date types if they go into an associative array with keys "date," "hour," and "minute" that is then set to the value of the property.

I have an idea of how it would work; I just need somebody who knows better than I do which code needs to be modified to walk the array in the special case of fieldmanager_datepicker fields.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.