[Flow] Validating dates amongst different objects
Mark Kuiphuis
typo3 at markyourweb.com
Wed Aug 14 08:41:40 CEST 2013
Hi all,
I am aware of the "DateTimeRangeValidator" which allows you to validate
a DateTime object whether that date is for example in between the
"latestDate" and the "earliestDate".
But is there a way to pass an extra one (or sometimes even 2 objects)
and use two properties of this object (startdate and enddate) to
validate the new date?
For example:
An employee starts working for one company. I create a new object called
employment which holds the company object, the employee object as well
as the start date (and/or) end date (the end date can be NULL if the
employee is still working for this company).
This employee can become a project leader for a certain project and I
need to record the start date (and potentially also the end date, but
not necessarily) and I would like to check that the start date of when
he/she becomes the project leader is after the start date of the employment.
All date information is available in the create or update actions of the
"ProjectLeader" controller, but then I am already too late (am I not?)
to go back to the new or edit form when the selected date is for example
before the start date of his/her employment.
(I even should check that, when creating the employment record, but also
the project leader record, that the start date of both records are later
than the date of birth of this employee :-)
Sorry for the long piece of text. I seem to struggle with keeping
questions short :-)
Kind regards,
Mark Kuiphuis
More information about the Flow
mailing list