Skip to content

Commit d73d51f

Browse files
Merge pull request #715 from andrea-kyurchiev/feat/make-calendar-show-in-user-timezone
feat: makes calendar show in user timezone
2 parents 86c4745 + 79dbb0a commit d73d51f

2 files changed

Lines changed: 9 additions & 7 deletions

File tree

assets/js/script.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44
// Preloader js
55
$(window).on('load', function () {
66
$('.preloader').fadeOut(100);
7+
var calendarContainer = document.getElementById('calendar-container');
8+
if(calendarContainer){
9+
const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone
10+
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>`
11+
calendarContainer.innerHTML = html;
12+
}
713
});
814

915
// Accordions

content/en/calendar/_index.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,10 @@ 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>
20-
21-

0 commit comments

Comments
 (0)