Page MenuHomePhabricator

Implement a basic `phutil_units()` function for writing "30 days in seconds" readably
ClosedPublic

Authored by epriestley on Feb 1 2014, 11:03 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Nov 26, 10:45 AM
Unknown Object (File)
Fri, Nov 22, 9:40 PM
Unknown Object (File)
Mon, Nov 18, 12:14 AM
Unknown Object (File)
Thu, Nov 14, 9:51 AM
Unknown Object (File)
Mon, Nov 11, 1:27 AM
Unknown Object (File)
Sun, Nov 10, 2:39 PM
Unknown Object (File)
Sun, Nov 10, 3:09 AM
Unknown Object (File)
Wed, Nov 6, 11:14 AM
Subscribers

Details

Summary

Fixes T4325. We have a fair amount of (60 * 60 * 24 * 15) // 15 days stuff in the codebase, and at least one of them was wrong (15 hours, when 15 minutes was probably intended). I was about to write some more, so I wrote this instead.

Make these self-documenting and harder to get wrong.

(This function could be more sophisticated, but I think this is the only real use case we hit.)

Test Plan

Added and ran unit tests.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped