5192615f4e274f3ddd7846d8118b50fd0723d239
A numeric $precision passed to round()/floor()/ceil() is always resolved
to the "second" unit. Once the precision reaches or exceeds 60 (e.g.
round(3600) meaning "nearest hour"), the rounding stayed confined to the
second field (range 0-59) and never carried into minute/hour/day, unlike
the equivalent string form (round('hour')).
Re-target the unit to minute/hour/day once the numeric precision reaches
that unit's own span in seconds, rescaling the precision accordingly,
mirroring the existing week -> day re-targeting already in roundUnit().
Sub-minute numeric precisions are unaffected.
Description
My contributions to briannesbitt/Carbon: 3 commits, 1 merged PRs
121 KiB
0 Stars
1 Watchers
0 Forks
Languages
PHP
100%