You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thank you for your work and sharing the multiple dates pickes.
In my project with natuw, it was to offer a calendar starting from today's date over 1 year.
Unfortunately with multiple dates they offer us the arrows to go to the next month.
I share with you the code that I made to make exactly 1 year exact, avoiding the following arrows for the following months depending on the date of the day.
If this code can help someone, because I was having a bit of difficulty avoiding the arrows, I would be very happy.
Thanks again to all the people who contributed to creating the multiple dates picker, because it really helped me in my natuw project
Sincerely
david lecuyer
/start calendarr/
function calendar_view(){
$('#datepicker2').multiDatesPicker('resetDates');
var jours=document.getElementById('altField').value;
var today = new Date();
var y = today.getFullYear();
let dates_choix=false;
if (jours!=""){
jours=jours.replace(/ /g,'');//on retire les espaces
dates_choix = jours.split(",");
}
var mois_en_cours=today.getMonth();
var mois_precedent=today.getMonth()-1;
var annee_en_cours=today.getFullYear();
var annee_suivante=today.getFullYear()+1;
var jours_en_cours=today.getDate();
var der_jours=GetLastDayOfThisMonth(mois_precedent);
var date_debut = new Date(annee_en_cours, mois_en_cours, jours_en_cours);
var date_fin = new Date(annee_suivante,mois_precedent,der_jours);
var result=datesDiff(date_debut, date_fin);
function datesDiff(a, b) {
a = a.getTime();
b = (b || new Date()).getTime();
var c = a > b ? a : b,
d = a > b ? b : a;
return Math.abs(Math.ceil((c - d) / 86400000));
}
function GetLastDayOfThisMonth (mois) {
var myDate = new Date ();
var myMonth = myDate.setMonth (mois+1);
var theDay = myDate.setDate (0);
var lastDay = myDate.getDate ();
return lastDay;
Hello everyone,
Thank you for your work and sharing the multiple dates pickes.
In my project with natuw, it was to offer a calendar starting from today's date over 1 year.
Unfortunately with multiple dates they offer us the arrows to go to the next month.
I share with you the code that I made to make exactly 1 year exact, avoiding the following arrows for the following months depending on the date of the day.
If this code can help someone, because I was having a bit of difficulty avoiding the arrows, I would be very happy.
Thanks again to all the people who contributed to creating the multiple dates picker, because it really helped me in my natuw project
Sincerely
david lecuyer
/start calendarr/
function calendar_view(){
$('#datepicker2').multiDatesPicker('resetDates');
var jours=document.getElementById('altField').value;
var today = new Date();
var y = today.getFullYear();
let dates_choix=false;
if (jours!=""){
jours=jours.replace(/ /g,'');//on retire les espaces
dates_choix = jours.split(",");
}
function datesDiff(a, b) {
a = a.getTime();
b = (b || new Date()).getTime();
var c = a > b ? a : b,
d = a > b ? b : a;
return Math.abs(Math.ceil((c - d) / 86400000));
}
function GetLastDayOfThisMonth (mois) {
var myDate = new Date ();
var myMonth = myDate.setMonth (mois+1);
var theDay = myDate.setDate (0);
var lastDay = myDate.getDate ();
return lastDay;
}
}
/end calendar/
The text was updated successfully, but these errors were encountered: