-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
308 additions
and
133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,27 @@ | ||
[workspace] | ||
members = ["builder"] | ||
|
||
[package] | ||
name = "_" | ||
version = "0.0.0" | ||
edition = "2021" | ||
|
||
[features] | ||
tokio_console = ["dep:console-subscriber"] | ||
|
||
[dependencies] | ||
anyhow = { version = "1.0.66", features = ["backtrace"] } | ||
anyhow = {version = "1.0.66", features = ["backtrace"]} | ||
camino = "1.1.4" | ||
chrono = { version = "0.4.19", features = ["serde"] } | ||
clap = { version = "4.1.4", features = ["derive"] } | ||
console-subscriber = { version = "0.1.8", optional = true } | ||
chrono = {version = "0.4.19", features = ["serde"]} | ||
clap = {version = "4.1.4", features = ["derive"]} | ||
console-subscriber = {version = "0.1.8", optional = true} | ||
futures = "0.3.28" | ||
indexmap = "1.9.2" | ||
once_cell = "1.16.0" | ||
serde = { version = "1.0.138", features = ["derive"] } | ||
serde = {version = "1.0.138", features = ["derive"]} | ||
serde_json = "1.0.82" | ||
ssg-parent = { version = "0.0.0", path = "ssg-parent" } | ||
ssg-parent = {version = "0.0.0", path = "ssg-parent"} | ||
thiserror = "1.0.40" | ||
# TODO less features | ||
tokio = { version = "1.21.0", features = ["full"] } | ||
tokio = {version = "1.21.0", features = ["full"]} | ||
url = "2.3.1" | ||
|
||
[features] | ||
tokio_console = ["dep:console-subscriber"] | ||
|
||
[package] | ||
name = "_" | ||
version = "0.0.0" | ||
edition = "2021" | ||
|
||
[workspace] | ||
members = ["builder"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,67 +1,74 @@ | ||
/* global FullCalendar */ | ||
; (function initCalendar({ events, displayEventTime, selectors }) { | ||
window.addEventListener('DOMContentLoaded', () => { | ||
const styleElm = document.createElement('style'); | ||
(function initCalendar({ events, displayEventTime, selectors }) { | ||
window.addEventListener("DOMContentLoaded", () => { | ||
const styleElm = document.createElement("style"); | ||
|
||
document.head.append(styleElm); | ||
|
||
styleElm.sheet.insertRule('.fc .fc-toolbar .fc-toolbar-title { font-size: inherit }') | ||
styleElm.sheet.insertRule('.fc .fc-toolbar.fc-header-toolbar { margin-bottom: 0.5em; }') | ||
styleElm.sheet.insertRule('.fc .fc-timegrid-slot { height: 2.5em; }') | ||
styleElm.sheet.insertRule('.fc .fc-col-header-cell-cushion { text-decoration: none; }') | ||
styleElm.sheet.insertRule( | ||
".fc .fc-toolbar .fc-toolbar-title { font-size: inherit }", | ||
); | ||
styleElm.sheet.insertRule( | ||
".fc .fc-toolbar.fc-header-toolbar { margin-bottom: 0.5em; }", | ||
); | ||
styleElm.sheet.insertRule(".fc .fc-timegrid-slot { height: 2.5em; }"); | ||
styleElm.sheet.insertRule( | ||
".fc .fc-col-header-cell-cushion { text-decoration: none; }", | ||
); | ||
|
||
const calendarContainerElm = document.querySelector(selectors.calendarContainer) | ||
const calendarContainerElm = document.querySelector( | ||
selectors.calendarContainer, | ||
); | ||
const calendar = new FullCalendar.Calendar(calendarContainerElm, { | ||
initialView: 'timeGridWeek', | ||
slotDuration: '01:00:00', | ||
initialView: "timeGridWeek", | ||
slotDuration: "01:00:00", | ||
expandRows: true, | ||
dayHeaderFormat: { weekday: 'short' }, | ||
dayHeaderFormat: { weekday: "short" }, | ||
views: { | ||
timeGridWeek: { | ||
allDaySlot: false | ||
} | ||
allDaySlot: false, | ||
}, | ||
}, | ||
events, | ||
eventContent: ({ event }) => ({ html: event.extendedProps.eventContent }), | ||
height: 'auto', | ||
contentHeight: 'auto', | ||
height: "auto", | ||
contentHeight: "auto", | ||
eventMinHeight: 40, | ||
nowIndicator: true, | ||
displayEventTime, | ||
eventBorderColor: 'transparent', | ||
eventBorderColor: "transparent", | ||
headerToolbar: false, | ||
stickyHeaderDates: false, | ||
}) | ||
}); | ||
|
||
const dateRangeElm = document.querySelector(selectors.dateRange) | ||
const timezoneElm = document.querySelector(selectors.timezone) | ||
const dateRangeElm = document.querySelector(selectors.dateRange); | ||
const timezoneElm = document.querySelector(selectors.timezone); | ||
|
||
calendar.on('datesSet', (dateInfo) => { | ||
const start = new Intl.DateTimeFormat().format(dateInfo.start) | ||
const end = new Intl.DateTimeFormat().format(dateInfo.end) | ||
dateRangeElm.textContent = `${start} – ${end}` | ||
timezoneElm.textContent = `Time zone: ${Intl.DateTimeFormat().resolvedOptions().timeZone}` | ||
}) | ||
calendar.on("datesSet", (dateInfo) => { | ||
const start = new Intl.DateTimeFormat().format(dateInfo.start); | ||
const end = new Intl.DateTimeFormat().format(dateInfo.end); | ||
dateRangeElm.textContent = `${start} – ${end}`; | ||
timezoneElm.textContent = `Time zone: ${Intl.DateTimeFormat().resolvedOptions().timeZone}`; | ||
}); | ||
|
||
const buttonPrevElm = document.querySelector(selectors.buttonPrev) | ||
const buttonPrevElm = document.querySelector(selectors.buttonPrev); | ||
|
||
buttonPrevElm.addEventListener('click', () => { | ||
calendar.prev() | ||
}) | ||
buttonPrevElm.addEventListener("click", () => { | ||
calendar.prev(); | ||
}); | ||
|
||
const buttonNextElm = document.querySelector(selectors.buttonNext) | ||
const buttonNextElm = document.querySelector(selectors.buttonNext); | ||
|
||
buttonNextElm.addEventListener('click', () => { | ||
calendar.next() | ||
}) | ||
buttonNextElm.addEventListener("click", () => { | ||
calendar.next(); | ||
}); | ||
|
||
const buttonTodayElm = document.querySelector(selectors.buttonToday) | ||
const buttonTodayElm = document.querySelector(selectors.buttonToday); | ||
|
||
buttonTodayElm.addEventListener('click', () => { | ||
calendar.today() | ||
}) | ||
|
||
calendar.render() | ||
}) | ||
}) | ||
buttonTodayElm.addEventListener("click", () => { | ||
calendar.today(); | ||
}); | ||
|
||
calendar.render(); | ||
}); | ||
}); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.