#6555 refactor to js #28
|
@ -92,7 +92,7 @@ function printTimetable(timetable) {
|
||||||
timetable.forEach((row, index) => {
|
timetable.forEach((row, index) => {
|
||||||
for (let day = weekDays.length - 1; day >= 0; day--) {
|
for (let day = weekDays.length - 1; day >= 0; day--) {
|
||||||
const img = createElement("img", { attrs: { src: ifIsEmptyImage(row[`${day}daysAgoDirection`]) } });
|
const img = createElement("img", { attrs: { src: ifIsEmptyImage(row[`${day}daysAgoDirection`]) } });
|
||||||
const p = createElement("p", { text: row[`${day}daysAgo`] });
|
const p = createElement("p", { text: ifIsEmptyText(row[`${day}daysAgo`]) });
|
||||||
|
|
||||||
const innerDiv = createElement("div", { childs: [img, p] });
|
const innerDiv = createElement("div", { childs: [img, p] });
|
||||||
const outerDiv = createElement("div", { classes: ["time", ifIsEmpty(row[`${day}daysAgo`])], childs: [innerDiv] });
|
const outerDiv = createElement("div", { classes: ["time", ifIsEmpty(row[`${day}daysAgo`])], childs: [innerDiv] });
|
||||||
|
@ -116,6 +116,8 @@ const ifIsEmpty = (value) => (value?.trim() ? "show" : "hide");
|
||||||
|
|
||||||
const ifIsEmptyImage = (value) => (value?.trim() ? `img/${value}.svg` : "img/in.svg");
|
const ifIsEmptyImage = (value) => (value?.trim() ? `img/${value}.svg` : "img/in.svg");
|
||||||
|
|
||||||
|
const ifIsEmptyText = (value) => (value?.toString()?.trim() ? value : "00:00");
|
||||||
|
|
||||||
function close() {
|
function close() {
|
||||||
localStorage.removeItem("userData");
|
localStorage.removeItem("userData");
|
||||||
setTimeout(() => (window.location = "index.html"), 200);
|
setTimeout(() => (window.location = "index.html"), 200);
|
||||||
|
|
Loading…
Reference in New Issue