Page MenuHomePhabricator

When printing timestamps on paper: use an absolute, context-free date format
ClosedPublic

Authored by epriestley on Sep 4 2020, 11:25 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Mar 27, 2:01 AM
Unknown Object (File)
Feb 24 2024, 4:20 AM
Unknown Object (File)
Feb 19 2024, 7:18 PM
Unknown Object (File)
Feb 16 2024, 6:50 AM
Unknown Object (File)
Jan 25 2024, 2:24 AM
Unknown Object (File)
Jan 24 2024, 4:33 AM
Unknown Object (File)
Dec 30 2023, 5:40 PM
Unknown Object (File)
Dec 28 2023, 6:10 PM
Subscribers
None

Details

Summary

Ref T13573. Using the browser "Print" feature on pages produces "Thu, Aug 4, 12:22" timestamps which require context to interpret precisely (they don't have a year and don't have a timezone).

Instead, retain these timestamps in "screen" contexts but use "YYYY-MM-DD HH:MM:SS (UTC+X)" timestamps when printing.

Test Plan

Printed Maniphest tasks and other pages in Safari and Chrome using "?print=1" and "Print to PDF", saw absolute timestamps after this chagne in the printed documents.

Diff Detail

Repository
rP Phabricator
Branch
date1
Lint
Lint Passed
Unit
Test Failures
Build Status
Buildable 24866
Build 34305: Run Core Tests
Build 34304: arc lint + arc unit

Unit TestsFailed

TimeTest
465 msPhabricatorLibraryTestCase::testLibraryMap
Assertion failed, expected 'true' (at PhutilLibraryTestCase.php:51): The library map is out of date. Rebuild it with `arc liberate`. These entries differ: function.phabricator_absolute_datetime, function.phabricator_dual_datetime.
5,310 msPhabricatorLibraryTestCase::testLibraryMap
Assertion failed, expected 'true' (at PhutilLibraryTestCase.php:51): The library map is out of date. Rebuild it with `arc liberate`. These entries differ: function.phabricator_absolute_datetime, function.phabricator_dual_datetime.
1 msAlmanacNamesTestCase::testServiceOrDeviceNames
30 assertions passed.
0 msAlmanacServiceTypeTestCase::testGetAllServiceTypes
1 assertion passed.
0 msAphrontHTTPHeaderParserTestCase::testHeaderParser
18 assertions passed.
View Full Test Results (2 Failed · 435 Passed · 2 Skipped)