laminas / laminas-validator

Validation classes for a wide range of domains, and the ability to chain validators to create complex validation criteria
https://docs.laminas.dev/laminas-validator/
BSD 3-Clause "New" or "Revised" License
126 stars 55 forks source link

Introduce `DateIntervalString` validator #389

Closed gsteel closed 1 month ago

gsteel commented 1 month ago
Q A
Documentation yes
New Feature yes
froschdesign commented 1 month ago

Should we provide a corresponding form element for this?

gsteel commented 1 month ago

Should we provide a corresponding form element for this?

Not sure about that. There's a lot of potential config options, such as which units should be allowed, Y,M,W,D and Time. I use a custom HTML element (Jabbascript) to take care of that and create the interval spec in JS before populating a hidden element. I think that it would be very ugly and unweildy in plain markup / PHP if it were a series of number inputs with config options for "allow this" and "hide that"…