Some additions to NSDate+Helpers to adjust the display string for a date based on an optional time zone. The default formatters use the device's time zone but we want to show the site time zone in many cases.
There is some performance penalty for this: about 2x as slow as not manipulating the time zone on the formatters. I think a cache could be added at some point but I'm not sure it's worth doing right now.
Added two tests:
testMediumStringRelativeString: Ensures relative formats are shown. This is not new functionality.
testMediumStringTimeZoneAdjust: Ensures methods are actually adjusting display strings by using the provided time zone.
WPiOS PR #13265
Addresses an issue with display strings for posts using the device instead of site time zone: https://github.com/wordpress-mobile/WordPress-iOS/issues/13258
Some additions to
NSDate+Helpers
to adjust the display string for a date based on an optional time zone. The default formatters use the device's time zone but we want to show the site time zone in many cases.There is some performance penalty for this: about 2x as slow as not manipulating the time zone on the formatters. I think a cache could be added at some point but I'm not sure it's worth doing right now.
Added two tests:
testMediumStringRelativeString
: Ensures relative formats are shown. This is not new functionality.testMediumStringTimeZoneAdjust
: Ensures methods are actually adjusting display strings by using the provided time zone.