-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove all the jQuery stuff in favor of some 2006 javascript
- Loading branch information
1 parent
fea17a3
commit 4cf180b
Showing
4 changed files
with
36 additions
and
7 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
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,3 +1,18 @@ | |||
$(function() { | (function(){ | ||
$('.timestamp').timezone(); | var | ||
}); | offset = (new Date()).getTimezoneOffset() * -60000, | ||
timestamps = document.getElementsByClassName("timestamp"), | |||
i, | |||
timestamp, | |||
date, | |||
label | |||
|
|||
for (i = 0; i < timestamps.length; i++) { | |||
timestamp = timestamps[i] | |||
date = new Date(parseInt(timestamp.attributes["data-unixtime"].value, 10) * 1000 + offset) | |||
label = (date.getHours() > 12 ? date.getHours() - 12 : date.getHours()) | |||
label += ":" + date.getMinutes() | |||
label += (date.getHours() >= 12 ? "PM" : "AM") | |||
timestamp.innerHTML = label | |||
} | |||
})() |
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 | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,7 @@ | |||
(function(){var offset=(new Date()).getTimezoneOffset()*-60000,timestamps=document.getElementsByClassName("timestamp"),i,timestamp,date,label | |||
for(i=0;i<timestamps.length;i++){timestamp=timestamps[i] | |||
date=new Date(parseInt(timestamp.attributes["data-unixtime"].value,10)*1000+offset) | |||
label=(date.getHours()>12?date.getHours()-12:date.getHours()) | |||
label+=":"+date.getMinutes() | |||
label+=(date.getHours()>=12?"PM":"AM") | |||
timestamp.innerHTML=label}})() |
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