Fixed december in calendar and modernized CSS
This commit is contained in:
parent
e08667ef11
commit
6cdb1c9bd8
1 changed files with 71 additions and 74 deletions
|
|
@ -18,7 +18,7 @@ function generate_calendar(calendarID, year, month)
|
|||
year = (wantedMonth - (wantedMonth % 12)) / 12
|
||||
month = wantedMonth % 12
|
||||
if month == 0 then
|
||||
month = 1
|
||||
month = 12
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -73,12 +73,12 @@ function generate_calendar(calendarID, year, month)
|
|||
for _, e in pairs(events) do
|
||||
local datematch = e.at.match(
|
||||
string.format("^%d-%02d-%02d( +[0-9]+:[0-9]+)?", year, month, day))
|
||||
if #datematch >= 2 and not datematch[2] then
|
||||
if datematch and #datematch >= 2 and not datematch[2] then
|
||||
cellcontent = cellcontent .. string.format(
|
||||
[[<a href="%s"><div class="event all-day">%s</div></a>]],
|
||||
e.ref, e.name
|
||||
)
|
||||
elseif #datematch >= 2 and datematch[2] then
|
||||
elseif datematch and #datematch >= 2 and datematch[2] then
|
||||
cellcontent = cellcontent .. string.format(
|
||||
[[
|
||||
<a href="%s">
|
||||
|
|
@ -166,16 +166,13 @@ end
|
|||
```space-style
|
||||
.calendartable {
|
||||
border-collapse: collapse;
|
||||
/* width: 500px; */
|
||||
}
|
||||
|
||||
.calendartable table {
|
||||
table {
|
||||
border-color: var(--panel-border-color);
|
||||
border: 2px solid #444;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
.calendartable th {
|
||||
th {
|
||||
width: 14%;
|
||||
padding: 3px;
|
||||
text-align: left;
|
||||
|
|
@ -184,34 +181,34 @@ end
|
|||
border: 1px solid #aaa;
|
||||
}
|
||||
|
||||
|
||||
.calendartable td {
|
||||
td {
|
||||
width: 14%;
|
||||
padding: 3px;
|
||||
text-align: left;
|
||||
vertical-align: top;
|
||||
border: 1px solid #aaa;
|
||||
}
|
||||
|
||||
.calendartable td.today {
|
||||
&.today {
|
||||
background-color: #f6f3c2;
|
||||
}
|
||||
|
||||
.calendartable a {
|
||||
text-decoration-line: none;
|
||||
color: var(--root-color);
|
||||
}
|
||||
}
|
||||
|
||||
.calendartable a.mark {
|
||||
a {
|
||||
text-decoration-line: none;
|
||||
color: var(--root-color);
|
||||
|
||||
&.mark {
|
||||
text-decoration-line: none;
|
||||
color: var(--ui-accent-text-color);
|
||||
}
|
||||
}
|
||||
|
||||
.calendartable span.extramarker {
|
||||
span.extramarker {
|
||||
background-color: yellow;
|
||||
}
|
||||
|
||||
.calendartable .event {
|
||||
.event {
|
||||
background-color: #2ca05a;
|
||||
color: #fff;
|
||||
border-radius: 4px;
|
||||
|
|
@ -221,20 +218,20 @@ end
|
|||
white-space: normal;
|
||||
overflow-wrap: normal !important;
|
||||
word-break: normal !important;
|
||||
}
|
||||
|
||||
.calendartable .event.all-day {
|
||||
&.all-day {
|
||||
background-color: #852624;
|
||||
}
|
||||
|
||||
.calendartable .event .time {
|
||||
.time {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.calendartable .month-prev,
|
||||
.calendartable .month-next,
|
||||
.calendartable .month-now {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.month-prev,
|
||||
.month-next,
|
||||
.month-now {
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue