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';
|
||||
</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" />
|
||||
<span class="ms-1 d-inline-block cal-title">{value}</span>
|
||||
<span class="float-end">
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import STATIC_LOCATIONS from './static-ens-locations.json'
|
||||
import ICAL from 'ical.js'
|
||||
|
||||
// https://stackoverflow.com/a/35970186
|
||||
function invertColor(hex) {
|
||||
|
@ -208,7 +209,9 @@ function mkExportUrl(id, { cloud }) {
|
|||
|
||||
function fetchCalendar(id, cal, extra = {}) {
|
||||
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))
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue