Validate dependent datetime-local inputs using laminas-inputfilter


I want to validate a small form in a non-Laminas application (therefore I don’t use the laminas-form component).

The form contains two datetime-local inputs:

To ensure the start date is before end date, I created an input filter like this:

Because Chromium strips the seconds part of the inputs (if not set explicitly), I added the DateTimeFormatter filter to parse different formats.

I have two questions:

  1. Is there a more elegant way to parse two dependent inputs?
  2. Why is the data in the context variable of the callback validator in the original format (Y-m-d\TH:i:s) while the value parameter contains the filtered (ATOM format) value?