".format("%.02d")" working in simulator but not on device.

I haven't changed the script for this, but after making a new build last night once on device my time string look like
1:1
instead of
01:01

var timeString;
var clockTime = Sys.getClockTime();
if (Sys.getDeviceSettings().is24Hour == true){
timeString = Lang.format("$1$:$2$", [clockTime.hour.format("%.02d"), clockTime.min.format("%.02d")]);
}
else{
timeString = Lang.format("$1$:$2$", [(clockTime.hour % 12), clockTime.min.format("%.02d")]);
}



  • Thank you all for your help.
    The issue was solved as Mark and others said.
    I was stupid and kept uploading the old version of the file to garmin.

    Please excuse my stupidity.

    Thanks again
    Joel
  • Thank you all for your help.
    The issue was solved as Mark and others said.
    I was stupid and kept uploading the old version of the file to garmin.

    Please excuse my stupidity.

    Thanks again
    Joel


    A comment on this. You can sideload an app to a real watch for testing without putting it the app store. Once you have it in the store, people will start installing it and give bad reviews if something doesn't work. The programmer's guide talks about sideloading, but all you really do is take a .prg for your target device, and copy it to \garmin\apps when the watch is mounted as a USB drive. No upload to garmin involved, and no bad reviews!

    (see the "build for device" in the eclipse Connect IQ menu)