Use en-dash in the time range instead of a hyphen for different format

Expected format: 00:00–02:00 or (2pm – 4pm)

Screenshots:
https://screenshot.googleplex.com/4RvaovK6RN7kjqo
https://screenshot.googleplex.com/ADZRr2TPuuctFre

Bug: 229264053
Test: make RunSettingsRoboTests
Change-Id: Ifd9bea0ce4525c8b582778e255104e875d365563
This commit is contained in:
ykhung
2022-04-17 14:42:16 +08:00
committed by YK Hung
parent b593e00af0
commit 91adbd3b16

View File

@@ -508,7 +508,9 @@ public class BatteryChartPreferenceController extends AbstractPreferenceControll
mBatteryHistoryKeys[mTrapezoidIndex * 2], mIs24HourFormat);
final String toHour = ConvertUtils.utcToLocalTimeHour(mPrefContext,
mBatteryHistoryKeys[(mTrapezoidIndex + 1) * 2], mIs24HourFormat);
return String.format("%s - %s", fromHour, toHour);
return mIs24HourFormat
? String.format("%s%s", fromHour, toHour)
: String.format("%s %s", fromHour, toHour);
}
@VisibleForTesting