Skip to content

Commit

Permalink
fix wrong method usage, getDay instead of getDate
Browse files Browse the repository at this point in the history
  • Loading branch information
oznakn committed Feb 21, 2021
1 parent cc1d9a1 commit ceb063c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
}

function toDateString(date) {
return `${date.getDay()}.${padLeft(date.getMonth()+1)}.${date.getFullYear()} ${padLeft(date.getHours())}:${padLeft(date.getMinutes())}`;
return `${padLeft(date.getDate())}.${padLeft(date.getMonth()+1)}.${date.getFullYear()} ${padLeft(date.getHours())}:${padLeft(date.getMinutes())}`;
}

function deleteItem(name) {
Expand Down Expand Up @@ -220,12 +220,12 @@

let date = new Date(takenAt);

if (date.getDay() !== lastDay || date.getMonth() !== lastMonth || date.getFullYear() !== lastYear) {
if (date.getDate() !== lastDay || date.getMonth() !== lastMonth || date.getFullYear() !== lastYear) {
preHtml = `<div class="grid-item grid-item-full">
<h3>${padLeft(date.getDay())}.${padLeft(date.getMonth()+1)}.${date.getFullYear()}</h3>
<h3>${padLeft(date.getDate())}.${padLeft(date.getMonth()+1)}.${date.getFullYear()}</h3>
</div>`;

lastDay = date.getDay();
lastDay = date.getDate();
lastMonth = date.getMonth();
lastYear = date.getFullYear();
}
Expand Down

0 comments on commit ceb063c

Please sign in to comment.