Compare commits
2 commits
master
...
ical_suppo
Author | SHA1 | Date | |
---|---|---|---|
|
e645024f38 | ||
|
4dc2343917 |
2 changed files with 5 additions and 2 deletions
|
@ -26,7 +26,7 @@
|
||||||
$: chevron = collapsed ? 'chevron-expand' : 'chevron-contract';
|
$: chevron = collapsed ? 'chevron-expand' : 'chevron-contract';
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<span class="cal w-100 d-block" on:click={handleClick}>
|
<span title={value} class="cal w-100 d-block" on:click={handleClick}>
|
||||||
<Icon name={icon} class="ms-2" />
|
<Icon name={icon} class="ms-2" />
|
||||||
<span class="ms-1 d-inline-block cal-title">{value}</span>
|
<span class="ms-1 d-inline-block cal-title">{value}</span>
|
||||||
<span class="float-end">
|
<span class="float-end">
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import STATIC_LOCATIONS from './static-ens-locations.json'
|
import STATIC_LOCATIONS from './static-ens-locations.json'
|
||||||
|
import ICAL from 'ical.js'
|
||||||
|
|
||||||
// https://stackoverflow.com/a/35970186
|
// https://stackoverflow.com/a/35970186
|
||||||
function invertColor(hex) {
|
function invertColor(hex) {
|
||||||
|
@ -208,7 +209,9 @@ function mkExportUrl(id, { cloud }) {
|
||||||
|
|
||||||
function fetchCalendar(id, cal, extra = {}) {
|
function fetchCalendar(id, cal, extra = {}) {
|
||||||
return fetch(mkCalendarUrl(id, cal, extra), { credentials: 'omit' })
|
return fetch(mkCalendarUrl(id, cal, extra), { credentials: 'omit' })
|
||||||
.then(resp => resp.json())
|
.then( cal.isICS
|
||||||
|
? resp => resp.text().then(text => ICAL.parse(text))
|
||||||
|
: resp => resp.json())
|
||||||
.catch(err => console.error(err))
|
.catch(err => console.error(err))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue