HomeGenie Forum
Development => Bug reporting => Topic started by: bradvoy on November 22, 2014, 10:11:56 PM
-
I am in the US where we expect to see dates in mm/dd/yy format. The doorwindow widget displays the update time in dd/mm/yy format. It looks like this is due to the following line in HG.WebApp.Utility.FormatDate (homegenie.webapp.js):
var dt = $.datepicker.formatDate('D, dd/mm/yy', date);
If I change this line to
var dt = date.toLocaleDateString();
then the date is displayed in the expected format. Is this a change that could/should be incorporated into the code base?
-
Can you try with attacched file and tell if it's working?
Thanks,
g.
-
Gene, this code does not fix the problem because HG.WebApp.Locales.GetDateEndianType() doesn't handle negative timezone offsets from UTC correctly. I am in the Mountain Standard timezone, which has an offset of -7 hours from UTC. After the line
var testDate = new Date(98326800000);
testDate evaluates to 18:00 on 11 February 1973 in my timezone. So localeDateParts[1] gets set to "11" and the function always returns 'L'. It should return 'M' for my locale.
-
well let's test against the month part then =D
g.
-
This one works great. Thanks for the quick fix.