Commit 125929ab authored by Raph El's avatar Raph El

Hotfix startdate

parent 8530c90d
......@@ -28,7 +28,7 @@ var agenda = {
},
getStartMoment : function(day){
console.log("agenda.getStartMoment", day);
return startMoment = moment(STARTDATE).local().set('date', moment(STARTDATE).get('date')+day).format();
return startMoment = moment(agenda.getStartDate()).local().set('date', moment(agenda.getStartDate()).get('date')+day).format();
},
searchDay : function(day){
console.log("agenda.searchDay", day);
......@@ -46,31 +46,19 @@ var agenda = {
this.searchDay(this.dayCount);
},
calculateAgendaWindow : function(nbMonth){
console.log("agenda.calculateAgendaWindow", nbMonth);
//TODO refaire la fonction et rendre custumisable la date de debut et de fin
console.log("directory.js calculateAgendaWindow", nbMonth);
//console.log("calculateAgendaWindow", nbMonth);
if(typeof STARTDATE == "undefined") return;
//console.log("calculateAgendaWindow ok");
var today = new Date();
var todayMoment = moment().local().seconds(0).minute(0).hour(0);
mylog.log("directory.js calculateAgendaWindow today", typeof today, today);
mylog.log("directory.js calculateAgendaWindow today", typeof todayMoment, todayMoment, todayMoment.valueOf());
today = new Date(today.setSeconds(0));
today = new Date(today.setMinutes(0));
today = new Date(today.setHours(0));
var todayUTC0 = moment(todayMoment.format()).local().utcOffset("+00:00");
STARTDATE = moment(todayUTC0.format()).local().valueOf();
mylog.log("directory.js calculateAgendaWindow today2", typeof today, today);
mylog.log("directory.js calculateAgendaWindow todayMoment", typeof todayMoment, todayMoment.format(), todayMoment.valueOf());
mylog.log("directory.js calculateAgendaWindow todayUTC0", typeof todayUTC0, todayUTC0, todayUTC0.format(), todayUTC0.valueOf());
mylog.log("directory.js calculateAgendaWindow STARTDATE", typeof STARTDATE, STARTDATE);
mylog.log("directory.js calculateAgendaWindow end",STARTDATE);
searchObject.startDate = Math.floor(STARTDATE / 1000);
getStartDate : function(){
var today = new Date();
var todayMoment = moment().seconds(0).minute(0).hour(0);
mylog.log("agenda.getStartDate today", typeof today, today);
mylog.log("agenda.getStartDate today", typeof todayMoment, todayMoment, todayMoment.valueOf());
today = new Date(today.setSeconds(0));
today = new Date(today.setMinutes(0));
today = new Date(today.setHours(0));
//var todayUTC0 = moment(todayMoment.format()).utcOffset("+00:00");
//STARTDATE = moment(todayMoment.format()).valueOf();
var STARTDATE = today.setDate(today.getDate());
return STARTDATE ;
},
scroll : function(){
mylog.log("agenda.scroll");
......
......@@ -293,7 +293,7 @@ jQuery(document).ready(function() {
calculateAgendaWindow(0);
if(typeof calendar != "undefined"){
if(typeof calendar != "undefined" && type=="events"){
calendar.init("#profil-content-calendar");
var endDate = moment(STARTDATE).set("month", moment(STARTDATE).get("month")+1).valueOf();
......
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