Skip to content

Commit

Permalink
1.1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
schefbi authored Nov 14, 2024
2 parents f4057b7 + eb29550 commit 1af6994
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 4 deletions.
11 changes: 11 additions & 0 deletions app.css
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,17 @@ table {
width:40px;
}

footer {
position: fixed;
bottom: 0px;
background: #0000004f;
padding: 5px;
right: 0;
color: white;
margin: auto;
font-size: large;
}

/* width */
::-webkit-scrollbar {
width: 7px;
Expand Down
37 changes: 34 additions & 3 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,8 @@ function getRoomReservation() {
from = from.substring(0, 10);
to = to.substring(0, 10);

document.getElementById('dateTimestamp').innerHTML = getCurrentDateTime();

getData(settings.restUrl + `/RoomReservation/Rooms/Occupancies/?filter.DateTimeFrom=${from}&filter.DateTimeTo=${to}&sort=DateTimeFrom.asc`)
.then((data) => {

Expand Down Expand Up @@ -242,6 +244,35 @@ function getRoomReservation() {
});
}

function getCurrentDateTime(){

const date = new Date();

// Function to convert
// single digit input
// to two digits
const formatData =
(input) => {
if (input > 9) {
return input;
} else return `0${input}`;
};


// Data about date
const format = {
dd: formatData(date.getDate()),
mm: formatData(date.getMonth() + 1),
yyyy: date.getFullYear(),
HH: formatData(date.getHours()),
MM: formatData(date.getMinutes()),
SS: formatData(date.getSeconds()),
};

return `${format.dd}.${format.mm}.${format.yyyy} ${format.HH}:${format.MM}`

}


/**
* Start Application
Expand Down Expand Up @@ -285,8 +316,8 @@ if ((buildingId === null || roomId === null) && instanceId === null) {
});

setInterval(() => {
getRoomReservation();

}, refresh === null ? 60000 : refresh * 60000);
getRoomReservation();
}, refresh === null ? 60000 : refresh * 60000);

}
3 changes: 2 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ <h5 id="header-h5"></h5>

<table id="events">
</table>

<footer id="dateTimestamp" class="footer date-time ">
</footer>
</body>

</html>

0 comments on commit 1af6994

Please sign in to comment.