_includes/heatmap.js in jekyll-zeta-0.9.3 vs _includes/heatmap.js in jekyll-zeta-0.9.4
- old
+ new
@@ -14,12 +14,14 @@
let m = t.getMonth() + 1;
let d = t.getDate();
return `${t.getFullYear()}-${m < 10 ? "0" + m : m}-${d < 10 ? "0" + d : d}`;
}
+ const strictMod = endYear && endYear.length == 4;
+ const maxDateYmd = `${endYear}-12-31`
const dateEnd =
- endYear && endYear.length == 4 ? new Date(`${endYear}-12-31`) : new Date();
+ endYear && endYear.length == 4 ? new Date(maxDateYmd) : new Date();
const endStamp = dateEnd.getTime();
const dayEleId = Math.random().toString(16).substring(2);
let arr = _allyearurl.split("/");
arr.pop();
@@ -175,19 +177,31 @@
SEQ[tmp] = tmp;
}
shuffle(SEQ);
+ const minYmd = `${endYear - 1}${maxDateYmd.substring(4)}`
function update1Day() {
if (G_idxOfDay < 0) {
return;
}
const idxOfDay = SEQ[G_idxOfDay--];
let dateKeyYmd = idx2Ymd(idxOfDay);
let arrPostInOneDay = Map[dateKeyYmd];
+
+ let hideblock = false
+ if (strictMod) {
+ hideblock = dateKeyYmd <= minYmd;
+
+ }
+
const dayCell = dayCells[idxOfDay];
- const nobg =
+ if (hideblock) {
+ dayCell.classList = 'heatmap-day-cell hm-check-notyet'
+ }else{
+
+ const nobg =
parseInt(dateKeyYmd.substring(5, 7)) % 2 == 1
? "hm-check-no-b"
: "hm-check-no-a";
dayCell.classList = `heatmap-day-cell ${
!arrPostInOneDay
@@ -225,9 +239,12 @@
t2.innerText = element.title;
lnk.appendChild(t2);
});
dayCell.appendChild(tip);
}
+ }
+
+
}
function updateMultiDays() {
let day = heatMapLoadCount;
if (!day || day <= 0) {