-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
v4.0.1: enable stand-alone use and add example
- Loading branch information
Rogier Schouten
committed
Oct 16, 2016
1 parent
dd750ee
commit 832a9e4
Showing
8 changed files
with
6,117 additions
and
63 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
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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
Large diffs are not rendered by default.
Oops, something went wrong.
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,35 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>Timezonecomplete Browser Example</title> | ||
<script src="./timezonecomplete.js"></script> | ||
<script> | ||
function doIt() { | ||
var utc = tc.nowUtc(); | ||
var local = utc.toZone(tc.zone('localtime')); | ||
var diff = local.toZone(null).diff(utc.toZone(null)); | ||
var hourDiff = tc.hours(diff.hours()); | ||
|
||
document.getElementById('utc').textContent = utc.format('dd-MMM-yyyy HH:mm:ss'); | ||
document.getElementById('local').textContent = local.format('dd-MMM-yyyy HH:mm:ss'); | ||
document.getElementById('diff').textContent = hourDiff.toString(); | ||
} | ||
</script> | ||
</head> | ||
<body onLoad="doIt()"> | ||
<p> | ||
The current UTC time is: | ||
<span id="utc"></div> | ||
</p> | ||
|
||
<p> | ||
The current local time is: | ||
<span id="local"></div> | ||
</p> | ||
<p> | ||
The difference is: | ||
<span id="diff"></div> | ||
</p> | ||
</body> | ||
</html> |
Oops, something went wrong.