Skip to content

Commit

Permalink
13 Sep 2023 Calendar
Browse files Browse the repository at this point in the history
Click on day number to add event.
  • Loading branch information
code-boxx committed Sep 13, 2023
1 parent 0f8b025 commit b14548f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
4 changes: 4 additions & 0 deletions calendar/assets/PAGE-calendar.css
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@
color: #b5b5b5;
padding: 5px;
}
.calRowHead .calCellDay:hover {
color: #ff5b5b;
cursor: pointer;
}
.calRowBack .calCell { border: 1px solid #eee; }
.calBlank { background: #f5f5f5; }
.calToday { background: #feffd3; }
Expand Down
12 changes: 11 additions & 1 deletion calendar/assets/PAGE-calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,17 @@ var cal = {
celler = day => {
cell = document.createElement("div");
cell.className = "calCell";
if (day) { cell.innerHTML = day; }
if (day) {
cell.innerHTML = day;
cell.classList.add("calCellDay");
cell.onclick = () => {
cal.show();
let d = +day, m = +cal.hMth.value,
s = `${cal.hYear.value}-${String(m<10 ? "0"+m : m)}-${String(d<10 ? "0"+d : d)}T00:00:00`;
cal.hfStart.value = s;
cal.hfEnd.value = s;
};
}
rowB.appendChild(cell);
cell = document.createElement("div");
cell.className = "calCell";
Expand Down
2 changes: 1 addition & 1 deletion calendar/pages/PAGE-calendar.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
</div>

<div class="w-100 p-1 form-floating">
<input id="evtTxt" class="form-control" type="text" required>
<input id="evtTxt" class="form-control" type="text" autocomplete="off" required>
<label>Event</label>
</div>

Expand Down

0 comments on commit b14548f

Please sign in to comment.