mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-01-12 23:53:15 +01:00
Merge branch 'master' of https://github.com/devcode-it/openstamanager
This commit is contained in:
commit
b711ea7c32
@ -1295,3 +1295,26 @@ function redirect(href, data, method, blank) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function setCookie(cname, cvalue, exdays) {
|
||||
var d = new Date();
|
||||
d.setTime(d.getTime() + (exdays*24*60*60*1000));
|
||||
var expires = "expires="+ d.toUTCString();
|
||||
document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
|
||||
}
|
||||
|
||||
function getCookie(cname) {
|
||||
var name = cname + "=";
|
||||
var decodedCookie = decodeURIComponent(document.cookie);
|
||||
var ca = decodedCookie.split(';');
|
||||
for(var i = 0; i <ca.length; i++) {
|
||||
var c = ca[i];
|
||||
while (c.charAt(0) == ' ') {
|
||||
c = c.substring(1);
|
||||
}
|
||||
if (c.indexOf(name) == 0) {
|
||||
return c.substring(name.length, c.length);
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
@ -512,6 +512,25 @@ if ($vista == 'mese') {
|
||||
|
||||
// Creazione del calendario
|
||||
create_calendar();
|
||||
|
||||
//Data di default
|
||||
$('.fc-prev-button, .fc-next-button, .fc-today-button').click(function(){
|
||||
var date_start = $('#calendar').fullCalendar('getView').start.format('YYYY-MM-DD');
|
||||
date_start = moment(date_start);
|
||||
|
||||
if('<?php echo $def; ?>'=='month'){
|
||||
if(date_start.date()>1){
|
||||
date_start = moment(date_start).add(1, 'M').startOf('month');
|
||||
}
|
||||
}
|
||||
|
||||
date_start = date_start.format('YYYY-MM-DD');
|
||||
setCookie('calendar_date_start', date_start, 365);
|
||||
});
|
||||
|
||||
calendar_date_start = getCookie('calendar_date_start');
|
||||
$('#calendar').fullCalendar( 'gotoDate', calendar_date_start );
|
||||
|
||||
});
|
||||
|
||||
function create_calendar(){
|
||||
|
Loading…
Reference in New Issue
Block a user