Closed openstrike closed 7 years ago
Looks like a cool addition! My only concern is the use of Test::Trap. I don't think Test::Trap is included in core? And as such, someone building from source wouldn't be able to run that test (as Test::Trap wouldn't be available). Perhaps one could rewrite it by catching it with eval instead?
No, Test::Trap isn't core. I've used it quite a bit previously and found it to be a simple way to test for exceptions. By couching it in the SKIP block it means that the tests shouldn't fail because of the absence of the module but as you say neither would they be run. It is very easy to replace with plain evals which has been done in the commit b6f2a73 just pushed.
Thanks for reviewing.
Are you happy with the amended PR which removes Test::Trap, @smith153? Are there any further modifications which you would like before merging?
Everything looks good to me. I tested it out a month ago or so and didn't see any issues. I should be merging this in next week and pushing out a new release :)
Merged :)
Here is an implementation of the proposed "truncate" method discussed in RT 62189. This is not a full replacement for the truncate method of DateTime because it does not handle either of the "week" or "local_week" options. It does cover all the other possible values of the "to" parameter, however.
There's a test script and a documentation update included.
Time::Piece is my module for this month's CPAN PR Challenge - thanks for participating!