I noticed that the pink date selection boxes are showing different dates than the dates the pictures were generated.
If I select the dates from the date picker manually, the images shows however, when I click on the pink boxes, it shows empty content most of the time, and the dates are incorrect compared to the folder names generated in the output directory.
Looking at the directory dates vs the pink boxes, it looks like the pink boxes dates are offset by one day.
After playing a bit with the code, I found out this was due to how JS processes dates, and how it uses UTC time by default, which was not matching my timezone (EST, UTC-5), hence the date discrepancy.
I made it work by adjusting the following two functions:
const goDate = (e) => {
console.log("goDate("+e.target.value+")");
// Changed the direct entry into Date with a split version of the date string broken by year, month, day
let wd_sp = e.target.value.split("-"); // split date into its parts
const day = new Date(parseInt(wd_sp[0]), parseInt(wd_sp[1])-1, parseInt(wd_sp[2])); // loading parts directly in Date object
console.log("day="+day);
day.setDate(day.getDate());
console.log("day="+day);
setDate(day);
}
and
function toggleCalendar() {
if (!promiseAll) {
new jBox('Notice', {
content: "All logs and images are not processed. Please wait...",
theme: 'TooltipDark',
attributes: {x: "right", y: "bottom"},
offset: { x: 20, y: 45 }
});
return;
}
if (workingDates.length>0) {
let list="";
for (let i=0; i<workingDates.length; i++) {
let wd_sp = workingDates[i].split("-"); // Same principle, splitting date into its parts
let dt=new Date(parseInt(wd_sp[0]), parseInt(wd_sp[1])-1, parseInt(wd_sp[2])); // loading parts directly in Date object
list+="<div class='workingDate' onclick='loadDay("+i+")'>"+dt.toLocaleDateString()+" <span class='nbImages'>"+detailDates[workingDates[i]]+" <span>📷</span></span></div>"
}
$("div#calendarList").html(list).toggle();
}
if (modeSearch) {
$("div#calendarList").hide();
}
}
Hello,
I noticed that the pink date selection boxes are showing different dates than the dates the pictures were generated.
If I select the dates from the date picker manually, the images shows however, when I click on the pink boxes, it shows empty content most of the time, and the dates are incorrect compared to the folder names generated in the
output
directory.Looking at the directory dates vs the pink boxes, it looks like the pink boxes dates are offset by one day.
After playing a bit with the code, I found out this was due to how JS processes dates, and how it uses UTC time by default, which was not matching my timezone (EST, UTC-5), hence the date discrepancy.
I made it work by adjusting the following two functions:
and