CC-3940: Calendar displays highlighting with regards to date and time of server instead of adjusting to the Timezone settings
-fixed (had to apply custom changes to new version of fullcalendar.js)
This commit is contained in:
parent
d348d21c10
commit
ebaff793be
4 changed files with 5261 additions and 200 deletions
|
@ -1,6 +1,6 @@
|
|||
/**
|
||||
* @preserve
|
||||
* FullCalendar v1.5.3
|
||||
* FullCalendar v1.5.3-CUSTOM (Changes by Martin Konecny -added primitive support for timezones)
|
||||
* http://arshaw.com/fullcalendar/
|
||||
*
|
||||
* Use fullcalendar.css for basic styling.
|
||||
|
@ -227,7 +227,7 @@ function Calendar(element, options, eventSources) {
|
|||
var absoluteViewElement;
|
||||
var resizeUID = 0;
|
||||
var ignoreWindowResize = 0;
|
||||
var date = new Date();
|
||||
var date = adjustDateToServerDate(new Date(), options["serverTimezoneOffset"]);
|
||||
var events = [];
|
||||
var _dragElement;
|
||||
|
||||
|
@ -2187,17 +2187,11 @@ function BasicView(element, calendar, viewName) {
|
|||
}else{
|
||||
clearEvents();
|
||||
}
|
||||
getOffset(firstTime);
|
||||
updateCells(firstTime);
|
||||
}
|
||||
|
||||
function getOffset(firstTime) {
|
||||
var timezoneOffset;
|
||||
$.ajax({ url: "/Api/calendar-init/format/json", dataType:"json", success:function(data) {
|
||||
timezoneOffset = data.calendarInit.timezoneOffset*1000;
|
||||
updateCells(firstTime, timezoneOffset);
|
||||
}, error:function(jqXHR, textStatus, errorThrown){}});
|
||||
}
|
||||
|
||||
|
||||
|
||||
function updateOptions() {
|
||||
rtl = opt('isRTL');
|
||||
if (rtl) {
|
||||
|
@ -2278,17 +2272,15 @@ function BasicView(element, calendar, viewName) {
|
|||
.appendTo(element);
|
||||
}
|
||||
|
||||
function updateCells(firstTime, timezoneOffset) {
|
||||
|
||||
|
||||
function updateCells(firstTime) {
|
||||
var dowDirty = firstTime || rowCnt == 1; // could the cells' day-of-weeks need updating?
|
||||
var month = t.start.getMonth();
|
||||
var today = clearTime(adjustDateToServerDate(new Date(), opt("serverTimezoneOffset")));
|
||||
var cell;
|
||||
var date;
|
||||
var row;
|
||||
|
||||
var today = new Date();
|
||||
var utc = today.getTime() + (today.getTimezoneOffset()*60000);
|
||||
var userTime = new Date(utc + timezoneOffset);
|
||||
today = clearTime(userTime);
|
||||
|
||||
if (dowDirty) {
|
||||
headCells.each(function(i, _cell) {
|
||||
|
@ -3118,7 +3110,7 @@ function AgendaView(element, calendar, viewName) {
|
|||
var headCell;
|
||||
var bodyCell;
|
||||
var date;
|
||||
var today = clearTime(new Date());
|
||||
var today = clearTime(adjustDateToServerDate(new Date(), opt("serverTimezoneOffset")));
|
||||
for (i=0; i<colCnt; i++) {
|
||||
date = colDate(i);
|
||||
headCell = dayHeadCells.eq(i);
|
||||
|
@ -5228,5 +5220,5 @@ function HorizontalPositionCache(getElement) {
|
|||
};
|
||||
|
||||
}
|
||||
|
||||
|
||||
})(jQuery);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue