- iOS Garmin Connect Mobile app
- All Garmin Connect IQ compatible devices
- Bug exists since CIQ SDK 1.2.0 release
Detailed Description:
The date picker in app settings in the iOS Garmin Connect Mobile (GCM) app incorrectly applies United States (US) DST in a non-US timezone, for example in South Africa.
South Africa does not have DST, but when I pick a date that falls within the US DST period, there is an offset of 1 hour compared to a date outside of this period.
I used this website to figure out the date ranges where the DST offsets differ:
https://www.timeanddate.com/time/change/usa
This bug report is related to this bug, but should be fixed separately: [DateTime] App Settings date picker in GCM iOS does not set the correct time
In a timezone / country with no DST, there should never be an offset in the chosen date from the date picker in app settings on GCM iOS.
Steps to reproduce:
- Create a watch face with a date property to be configured with app settings
- Make sure to print the numerical value (epoch) of this property on the device's display
- Use the bottom code to convert the epoch to a moment and then UTC date and time.
- Display the UTC date and time below the epoch.
- Upload the watch face to the store
- Install the watch face to a device with minimum SDK version 2.1.0 (dependency on utcInfo)
- Take note on this site that the US DST dates are: https://www.timeanddate.com/time/change/usa
12 Mar 2017 - Daylight Saving Time Started
5 Nov 2017 - Daylight Saving Time Ends - Use GCM app on iOS to configure the settings for the watch face.
- Pick a date outside the DST period, like 10 March 2017 and save the settings.
- Note the UTC time on the screen
- Configure the date again, but select a date within the DST period, like 3 Nov 2017 and save it
- Note the UTC time on the screen and compare with the first time.
You will see a 1 hour difference
Dates from 13 March 2017 to 5 November 2017 have 5 hour offset
Dates before 13 March 2017 and after 5 November 2017 have 6 hour offset
The DST change is in accordance to the info found here:
(https://www.timeanddate.com/time/change/usa)
Code sample:
function onSettingsChanged(){
loadSettings();
Ui.requestUpdate();
}
function loadSettings(){
epoch = App.getApp().getProperty("Date");
moment = epoch ? new Cal.Moment(epoch) : null;
}
function momentToUtcStr(moment){
var info = Cal.utcInfo(moment, Time.FORMAT_LONG);
return Lang.format("$1$ $2$ $3$ - $4$:$5$", [info.day, info.month, info.year, info.hour, info.min.format("%02d")]);
}
Source Code available on request
Time within the US DST period:
[IMG2=JSON]{"data-align":"none","data-size":"full","src":"https:\/\/forums.garmin.com\/attachment.php?attachmentid=41533&d=1491355090"}[/IMG2]
Time outside the US DST period with 1 hour offset to above time:
[IMG2=JSON]{"data-align":"none","data-size":"full","src":"https:\/\/forums.garmin.com\/attachment.php?attachmentid=41534&d=1491355149"}[/IMG2]