Problem description
When I display the date/time localized for my timezone it does not update if I change the timezone on the device while the app is running. It maintains the old timezone. This causes the time portion (and possibly the day) to not change as expected.
Test Code
var win = Ti.UI.createWindow({
backgroundColor : 'red'
});
var btn = Ti.UI.createButton({
title : 'Now',
top : 10,
left : 10,
width : 200,
height : 50
});
win.add(btn);
btn.addEventListener('click', function(evt) {
var d = new Date();
local.text = d.toLocaleString();
utc.text = d.toUTCString();
});
var local = Ti.UI.createLabel({
text : '?',
top : 100,
left : 10,
right : 10,
height : 50
});
win.add(local);
var utc = Ti.UI.createLabel({
text : '?',
top : 200,
left : 10,
right : 10,
height : 50
});
win.add(utc);
win.open();
Step to reproduces:
1) Set timezone of device to Pacific
2) Run the app
3) Tap "Now" button
4) Note that the top date string is localized to Pacific timezone
5) Do not kill the app
6) Open device settings
7) Change timezone to Eastern
8) Go back to app
9) Tap "Now" button
10) Force close the app and relaunch
11) Tap "Now"
Expected Result
The top localized date string displays in Easter time (3 hours ahead)
Result:
The date time still reflect a Pacific timezone *HOWEVER* the displayed timezone is Eastern. The displayed timezone code is just information. It had no bearing on the date time localization.
Is this a regression from a previous version?
3.4.0 is moved forward, and 3.5.0 is taking its place in the calendar.
Date.toLocaleString() is a native Javascript method, not a Titanium API.
Closing this ticket as the issue is not our bug.