Mock simulator / device time format setting

76 views Asked by At

There was a bug within our app where if the user set their time format in settings to the 24-Hour Time format, the time would not show up as desired, which is always in the 12 hour format with am/pm.

The fix was to add the "en_US_POSIX" locale specified here: https://stackoverflow.com/a/36862162/1619193

I want to write a unit test to verify this functionality, however we cannot really set this 24 hour format in a simulator in order to test this.

Is there anyway to mock this setting for a unit test, the closest I came to finding something out is to figure out if the device is set to 12 hour or 24 hours: https://stackoverflow.com/a/46738159/1619193

But nothing to really force the device to a 24 hour setting.

Any ideas on how to accomplish this ?

0

There are 0 answers