SensioFrameworkExtraBundle icon indicating copy to clipboard operation
SensioFrameworkExtraBundle copied to clipboard

Add a DateInterval ParamConverter

Open lgeorget opened this issue 3 years ago • 0 comments

Hi!

I don't know if you're interested in this kind of contribution but I needed a ParamConverter for DateInterval objects in a project lately and I thought it could be a useful addition to this bundle along with the already present DateInterval converter.

This converter converts string such as "P1DT3H30M" or "2 weeks" passed as parameter URLs into DateInterval objects.

I've also added some tests of course, mostly by copying what had been done for DateTimeParamConverter. Let me know if more are needed.

Cheers,

Laurent

lgeorget avatar May 23 '21 22:05 lgeorget