CC-3940: Calendar displays highlighting with regards to date and time of server instead of adjusting to the Timezone settings
-fixed
This commit is contained in:
parent
be02906565
commit
da7e44a78c
|
@ -2187,11 +2187,18 @@ function BasicView(element, calendar, viewName) {
|
||||||
}else{
|
}else{
|
||||||
clearEvents();
|
clearEvents();
|
||||||
}
|
}
|
||||||
updateCells(firstTime);
|
getOffset();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getOffset() {
|
||||||
|
var timezoneOffset;
|
||||||
|
$.ajax({ url: "/Api/calendar-init/format/json", dataType:"json", success:function(data) {
|
||||||
|
timezoneOffset = data.calendarInit.timezoneOffset*1000;
|
||||||
|
var firstTime = !body;
|
||||||
|
updateCells(firstTime, timezoneOffset);
|
||||||
|
}, error:function(jqXHR, textStatus, errorThrown){}});
|
||||||
|
}
|
||||||
|
|
||||||
function updateOptions() {
|
function updateOptions() {
|
||||||
rtl = opt('isRTL');
|
rtl = opt('isRTL');
|
||||||
if (rtl) {
|
if (rtl) {
|
||||||
|
@ -2272,15 +2279,17 @@ function BasicView(element, calendar, viewName) {
|
||||||
.appendTo(element);
|
.appendTo(element);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function updateCells(firstTime, timezoneOffset) {
|
||||||
|
|
||||||
function updateCells(firstTime) {
|
|
||||||
var dowDirty = firstTime || rowCnt == 1; // could the cells' day-of-weeks need updating?
|
var dowDirty = firstTime || rowCnt == 1; // could the cells' day-of-weeks need updating?
|
||||||
var month = t.start.getMonth();
|
var month = t.start.getMonth();
|
||||||
var today = clearTime(new Date());
|
|
||||||
var cell;
|
var cell;
|
||||||
var date;
|
var date;
|
||||||
var row;
|
var row;
|
||||||
|
|
||||||
|
var today = new Date();
|
||||||
|
var utc = today.getTime() + (today.getTimezoneOffset()*60000);
|
||||||
|
var userTime = new Date(utc + timezoneOffset);
|
||||||
|
today = clearTime(userTime);
|
||||||
|
|
||||||
if (dowDirty) {
|
if (dowDirty) {
|
||||||
headCells.each(function(i, _cell) {
|
headCells.each(function(i, _cell) {
|
||||||
|
|
Loading…
Reference in New Issue