-
-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6e4a6cd
commit a707bed
Showing
12 changed files
with
329 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<!-- | ||
This is HTML and JavaScript that allows changing a calendar URL specific to a timezone. | ||
TODO: Choose the time zones that you want the viewer to choose: | ||
--> | ||
<select id="timezoneOption"><option value="America/New_York">New York</option><option value="Europe/London">London</option><option value="Asia/Singapore">Singapore</option><option value="">My Local Time Zone</option></select> | ||
|
||
<script> | ||
// TODO: Set the iframe id: | ||
var calendarIFrameID = "owcTimezoneExample"; | ||
var originalUrl; // the oririginal URL of the iframe | ||
var calendarIFrame; // the stored iframe as a variable | ||
|
||
// Save the original URL | ||
function setInitialTimezone() { | ||
calendarIFrame = document.getElementById(calendarIFrameID); | ||
originalUrl = calendarIFrame.src; | ||
changeTimezone(); | ||
} | ||
|
||
// Change to the selected timezone | ||
function changeTimezone() { | ||
console.log("change timezone: " + timezoneOption.value); | ||
calendarIFrame.src = originalUrl + (timezoneOption.value ? "timezone=" + timezoneOption.value : ""); | ||
console.log("url: " + calendarIFrame.src); | ||
} | ||
|
||
window.addEventListener("load", setInitialTimezone); | ||
timezoneOption.onchange = changeTimezone; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.