add links to mountView

This commit is contained in:
Laila van Reenen 2024-03-16 19:43:26 +01:00
parent 11ca02bb91
commit 5a079ff413
2 changed files with 20 additions and 6 deletions

View File

@ -9,14 +9,14 @@
}
.frcal__time {
flex: 3;
flex: 2;
border-right: var(--color-base-40) 1px solid;
}
.frcal__month {
width: 100%;
display: flex;
/*position: fixed;*/
min-width: 1000px;
}
.frcal__month_first {
@ -36,7 +36,7 @@
.frcal__days {
display: flex;
flex-wrap: nowrap;
min-width: 700px;
min-width: 1000px;
}
.frcal__day {
flex: 10;
@ -159,8 +159,12 @@
text-align: center;
}
.frcal__mountView tr:hover {
background-color: var(--background-secondary);
}
.frcal__month_month {
border-bottom: 1px solid var(--text-normal);
background-color: var(--background-primary);
}
.frcal__weekinmonth {

14
main.js
View File

@ -399,7 +399,11 @@ class CalendarView extends ItemView
let table = this.mountView.createEl('table');
for (let week = moment(startMonth); week < endMonth; week.add(1, "weeks"))
{
let row = table.createEl("tr");
let row = table.createEl("tr", {
attr: {
onclick: "app.workspace.getLeavesOfType('" + VIEW_TYPE_CALENDAR + "')[0].view.mountViewClick('" + stringifySingleDate(week).match(DateFormat.week) + "')"
}
});
let thursday = moment(week).day(4);
@ -414,7 +418,7 @@ class CalendarView extends ItemView
lastDayOfMount.add(1, "weeks");
}
// let span = moment(week).add(1, "months").date(4).isoWeek() - week.isoWeek();
row.createEl("td", { attr: { rowspan: span, cls: 'frcal__month_month' } }).innerText = (thursday.month() + 1).toString() + " - " + DateFormat.months[thursday.month()];
row.createEl("td", { attr: { rowspan: span }, cls: 'frcal__month_month' }).innerText = (thursday.month() + 1).toString() + " - " + DateFormat.months[thursday.month()];
}
row.createEl('td', { cls: 'frcal__weekinmonth' }).innerText = week.isoWeek();
@ -432,6 +436,12 @@ class CalendarView extends ItemView
this.mountView.style.display = "block";
}
mountViewClick(week)
{
this.mountView.style.display = "none";
this.gotoThisWeek(week);
}
async onClose()
{
// Nothing to clean up.