Closed mstnorris closed 5 years ago
@mstnorris Could you have a look at #26 if this might fit your needs?
@jeromegamez sorry I had not seen this until now. Thank you! I will play around with it this evening and let you know.
@jeromegamez apologies as I have been busy and haven't had a chance to test this out. I will do so this week and come back to you.
@jeromegamez I finally got round to testing this and I'm happy to say that it works. Thanks.
We'll try to merge https://github.com/spatie/period/pull/26 soon!
Following on from Length with precision and the 2.0 discussion I think it would be useful to be able to call
->length()
on a PeriodCollection (with an optional precision) to return the total duration of all the periods contained within, combined. This could be aliased to duration.Proposed
Current
This can be achieved by using a Laravel Collection and passing a closure to the
sum
method but I think this should be part of this package.