Skip to content

Commit 72bdd0b

Browse files
feat: makes calendar show in user timezone
1 parent f987cb9 commit 72bdd0b

2 files changed

Lines changed: 11 additions & 5 deletions

File tree

assets/js/script.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
// Preloader js
55
$(window).on('load', function () {
66
$('.preloader').fadeOut(100);
7+
if(document.getElementById('calendar-container')){
8+
const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone
9+
const html = `<iframe src="https://calendar.google.com/calendar/embed?src=c_62694f414055ac569e5cb12dafbb0890ca22f3640b177a4b10b53171fbc9bdd4%40group.calendar.google.com&ctz=${timezone}" style=" border:0 " width="800" height="600" frameborder="0" scrolling="no"></iframe>`
10+
document.getElementById('calendar-container').innerHTML = html;
11+
}
712
});
813

914
// Accordions

content/en/calendar/_index.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,15 @@ draft: false
88
<section class="section">
99
<div class="container">
1010
<div class="row align-items-center">
11-
<p>Welcome to the InnerSource Commons Calendar! Our events and working groups are open to everyone because we know that magic happens when people come together to share their experience and knowledge.
12-
<p>A note about this calendar ... If you're using google, our calendar may display in the GMT timezone. To make sure you see events in your own timezone, please open the calendar on an incognito browser window or use a different search engine.
13-
<div class="col-md-6 order-1 order-md-2 mb-4 mb-md-0">
14-
<iframe src="https://calendar.google.com/calendar/embed?src=c_62694f414055ac569e5cb12dafbb0890ca22f3640b177a4b10b53171fbc9bdd4%40group.calendar.google.com" style="border: 0" width="800" height="600" frameborder="0" scrolling="no"></iframe> </p>
15-
</div>
11+
<p>Welcome to the InnerSource Commons Calendar! Our events and working groups are open to everyone because we know that magic happens when people come together to share their experience and knowledge. </p>
12+
<div class="col-md-6 order-1 order-md-2 mb-4 mb-md-0" id="calendar-container">
13+
</div>
1614
</div>
1715
</div>
1816
</div>
1917
</section>
2018

19+
<script type="text/javascript">
20+
21+
</script>
2122

0 commit comments

Comments
 (0)