I try to let the user enter contract hours. For example 40:00 contract hours.
Currently I have it working:
/**
* @ORM\Column(type="string", nullable=true)
* @Assert\Regex(
* pattern="/[0-9]{2}:[0-5]{1}[0-9]{1}/",
* match=true,
* message="Enter a correct time value, for example 37:30"
* )
*/
private $standardFulltimeHours;
However I then need to create a service that converts the string format to a DateTime.
The DateInterval can be a solution, however I tried it in my setup and could not get it working as I liked. There's also little documentation available.
Do you have any ideas?