-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
217 lines (169 loc) · 6.81 KB
/
Copy pathindex.html
File metadata and controls
217 lines (169 loc) · 6.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Local Time Google Calendar Viewer</title>
<meta name="description" content="Share public Google Calendars without worrying about time zones. Create a link that automatically displays events in each visitor's local time." />
<link rel="icon" href="/favicon.ico" type="image/x-icon">
<meta property="og:title" content="Local Time Google Calendar Viewer" />
<meta property="og:description" content="Share public Google Calendars without worrying about time zones. Create a link that automatically displays events in each visitor's local time." />
<meta property="og:image" content="/banner-image.webp" />
<meta property="og:image:width" content="1774" />
<meta property="og:image:height" content="887" />
<meta property="og:image:type" content="image/webp" />
<meta property="og:url" content="https://calendar.gozarproductions.com" />
<meta property="og:site_name" content="Local Time Google Calendar" />
<meta property="og:type" content="website" />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:title" content="Local Time Google Calendar" />
<meta name="twitter:description" content="Share public Google Calendars without worrying about time zones. Create a link that automatically displays events in each visitor's local time." />
<meta name="twitter:image" content="/banner-image.webp" />
<link rel="canonical" href="https://calendar.gozarproductions.com/">
<style>
* {
box-sizing: border-box;
}
body {
margin: 0;
padding: 24px;
font-family: system-ui, sans-serif;
background: #f5f5f5;
}
.container {
max-width: 1200px;
margin: 0 auto;
}
iframe {
width: 100%;
height: 800px;
border: none;
border-radius: 10px;
background: white;
box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.note {
margin-top: 12px;
text-align: center;
font-style: italic;
color: #666;
}
#githubLink {
font-style: normal;
}
.error {
padding: 24px;
background: white;
border-radius: 10px;
text-align: center;
box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
code {
background: #eee;
padding: 2px 4px;
border-radius: 4px;
}
#instructions {
max-width: 600px;
margin: 0 auto;
}
ul {
margin: auto;
max-width: 300px;
text-align: left;
}
.hidden {
display: none;
}
@media (max-width: 480px), (max-height: 480px) {
body {
padding: 16px;
}
.container {
display: flex;
flex-direction: column;
min-height: calc(100vh - 32px);
}
iframe {
height: auto;
min-height: 75vh;
flex: 1;
}
.note {
font-size: 0.9rem;
line-height: 1.4;
padding: 0 8px;
}
code {
word-break: break-all;
}
}
</style>
</head>
<body>
<div class="container" id="app">
<div class="error" id="instructions">
<h1>Local Time Google Calendar</h1>
<h2>View Any Public Google Calendar in Your Local Time Zone</h2>
<p>Have you ever wanted to share a Google Calendar with people in different time zones without making everyone convert the event times themselves? This page makes that easy.</p>
<p>Simply provide the src value from any public Google Calendar embed link, and this viewer will automatically display the calendar using <strong>the visitor's own local time zone</strong>. Whether someone is in Arizona, New York, London, Tokyo, Sydney, or anywhere else in the world, Google Calendar will display the events in their local time.</p>
<p>This tool is perfect for:</p>
<ul>
<li>Online events</li>
<li>Livestream schedules</li>
<li>Community calendars</li>
<li>Gaming events</li>
<li>Virtual conventions</li>
<li>Club meetings</li>
<li>International teams</li>
<li>Anyone sharing events across multiple time zones</li>
</ul>
<p>No Google account is required to view the calendar, and visitors do not need to add the calendar to their own Google Calendar.</p>
<h2>How to Use</h2>
<p>Just copy and paste the <code>src</code> attribute from the embed link of your public Google Calendar after a <code>?</code> in the URL like this:</p>
<p><code>?src=your_calendar@group.calendar.google.com</code></p>
<p>You can also provide an entire Google Calendar embed URL:</p>
<p><code>?src=https://calendar.google.com/calendar/embed?src=...</code></p>
<p>So the final link would be like this:</p>
<p><code>https://calendar.gozarproductions.com/?src=your_calendar@group.calendar.google.com</code></p>
<p>or</p>
<p><code>https://calendar.gozarproductions.com/?src=https://calendar.google.com/calendar/embed?src=...</code></p>
<p>When someone opens your generated link, the calendar is automatically displayed in <strong>their own local time zone</strong>, making it easy to share schedules with people anywhere in the world.</p>
</div>
<iframe id="calendar" class="hidden"></iframe>
<div class="note" id="githubLink">View my other projects at <a href="https://GozarProductions.com" target="_blank">GozarProductions.com</a></div>
<div class="note hidden" id="note"></div>
</div>
<script>
const params = new URLSearchParams(location.search);
const srcParam = params.get("src");
const instructions = document.getElementById("instructions");
const iframe = document.getElementById("calendar");
const note = document.getElementById("note");
const githubLink = document.getElementById("githubLink");
if (!srcParam) {
throw new Error("Missing src");
}
instructions.classList.add("hidden");
githubLink.classList.add("hidden");
iframe.classList.remove("hidden");
note.classList.remove("hidden");
const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
let calendarURL;
if (srcParam.startsWith("http")) {
calendarURL = new URL(srcParam);
calendarURL.searchParams.set("ctz", timezone);
if (!calendarURL.pathname.includes("/embed")) {
calendarURL.pathname = "/calendar/embed";
}
} else {
calendarURL = new URL("https://calendar.google.com/calendar/embed");
calendarURL.searchParams.set("src", srcParam);
calendarURL.searchParams.set("ctz", timezone);
}
calendarURL.searchParams.set("mode", "MONTH");
iframe.src = calendarURL.toString();
note.textContent = `*Displaying events in the local timezone for ${timezone}`;
</script>
</body>
</html>