Commit 9263b171 authored by Raph El's avatar Raph El

Hotfix agenda

parent dfce793f
......@@ -13,12 +13,15 @@ var agenda = {
limitSearch : 7,
nbSearch : 0,
finishSearch: false,
today : null,
init : function(pInit){
//mylog.log("agenda.init", pInit);
mylog.log("agenda.init", pInit);
this.dayCount = ( (typeof pInit != "undefined" && typeof pInit.dayCount != "undefined") ? pInit.dayCount : 0 )
this.finishSearch = false;
this.today = this.getStartDate();
},
getDateHtml : function(startMoment){
mylog.log("agenda.getDateHtml ", startMoment, moment(startMoment).local().locale("fr").format('dddd DD MMMM'));
var strdate = '<div class="col-xs-12">' +
'<div class="dayEvent col-xs-12">' +
'<h2 class="text-white date" style="text-transform:inherit;padding-left:15px;">' +
......@@ -36,8 +39,10 @@ var agenda = {
$(cont).append(strdate);
},
getStartMoment : function(day){
var todayAgenda = this.today;
// mylog.log("agenda.getStartMoment", day);
var startMoment = moment(agenda.getStartDate()).local().set('date', moment(agenda.getStartDate()).get('date') + day).format();
//var startMoment = moment(agenda.getStartDate()).local().set('date', moment(agenda.getStartDate()).get('date') + day).format();
var startMoment = moment(todayAgenda).local().set('date', moment(todayAgenda).get('date') + day).format();
return startMoment;
},
searchDay : function(day){
......@@ -231,10 +236,12 @@ var calendar = {
// change the day's background color just for fun
$(calendar.domTarget+" .fc-day").removeClass("activeDay");
$(this).addClass("activeDay");
agenda.today = moment(date.format()).valueOf();
calendar.searchInAgenda(date.format(), "day");
agenda.dayCount = 0;
STARTDATE = moment(date.format()).valueOf();
searchObject.startDate = STARTDATE;
// alert('nextis clicked, do something');
}
});
......@@ -264,6 +271,7 @@ var calendar = {
//var startDDDD = new Date(now);
STARTDATE = moment(now.format()).valueOf();
searchObject.startDate = STARTDATE;
agenda.today = moment(now.format()).valueOf();
calendar.searchInAgenda(now.format(), "month");
});
......@@ -274,6 +282,7 @@ var calendar = {
//var startDDDD = new Date(now);
STARTDATE = moment(now.format()).valueOf();
searchObject.startDate = STARTDATE;
agenda.today = moment(now.format()).valueOf();
calendar.searchInAgenda(now.format(), "month");
// alert('nextis clicked, do something');
});
......
......@@ -73,7 +73,7 @@ if(isset($this->costum) && !empty($calendarParams)){
jQuery(document).ready(function() {
mylog.log("calendar.php", searchObject.startDate);
agenda.today = agenda.getStartDate();
});
</script>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment