Skip to content

Commit b14548f

Browse files
committed
13 Sep 2023 Calendar
Click on day number to add event.
1 parent 0f8b025 commit b14548f

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

calendar/assets/PAGE-calendar.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@
5757
color: #b5b5b5;
5858
padding: 5px;
5959
}
60+
.calRowHead .calCellDay:hover {
61+
color: #ff5b5b;
62+
cursor: pointer;
63+
}
6064
.calRowBack .calCell { border: 1px solid #eee; }
6165
.calBlank { background: #f5f5f5; }
6266
.calToday { background: #feffd3; }

calendar/assets/PAGE-calendar.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,17 @@ var cal = {
112112
celler = day => {
113113
cell = document.createElement("div");
114114
cell.className = "calCell";
115-
if (day) { cell.innerHTML = day; }
115+
if (day) {
116+
cell.innerHTML = day;
117+
cell.classList.add("calCellDay");
118+
cell.onclick = () => {
119+
cal.show();
120+
let d = +day, m = +cal.hMth.value,
121+
s = `${cal.hYear.value}-${String(m<10 ? "0"+m : m)}-${String(d<10 ? "0"+d : d)}T00:00:00`;
122+
cal.hfStart.value = s;
123+
cal.hfEnd.value = s;
124+
};
125+
}
116126
rowB.appendChild(cell);
117127
cell = document.createElement("div");
118128
cell.className = "calCell";

calendar/pages/PAGE-calendar.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
</div>
6666

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

0 commit comments

Comments
 (0)