summaryrefslogtreecommitdiff
path: root/templates/main.js
diff options
context:
space:
mode:
authorMichael Save <savetheinternet@tinyboard.org>2012-03-15 16:16:54 +1100
committerMichael Save <savetheinternet@tinyboard.org>2012-03-15 16:16:54 +1100
commit14a2f9732387a5efdb232f4e0f9ebb00b81b25ed (patch)
tree97df2ced4376b274be3a63ba21e531ee69d8844c /templates/main.js
parent1769de4cdce259bedd98973cdf5a3af8a99fcbf1 (diff)
Moved $config['local_time'] to Tinyboard-Tools (local-time.js)
Diffstat (limited to 'templates/main.js')
-rw-r--r--templates/main.js35
1 files changed, 0 insertions, 35 deletions
diff --git a/templates/main.js b/templates/main.js
index 1113617e..42d38eb9 100644
--- a/templates/main.js
+++ b/templates/main.js
@@ -168,41 +168,6 @@ function init_expanding() {
}
}
-{% endraw %}
-{% if config.javascript_local_time %}
-{% raw %}
-function init_localtime(){
- var iso8601 = function iso8601(s) {
- s = s.replace(/\.\d\d\d+/,""); // remove milliseconds
- s = s.replace(/-/,"/").replace(/-/,"/");
- s = s.replace(/T/," ").replace(/Z/," UTC");
- s = s.replace(/([\+\-]\d\d)\:?(\d\d)/," $1$2"); // -04:00 -> -0400
- return new Date(s);
- };
- var zeropad = function(num, count) {
- return [Math.pow(10, count - num.toString().length), num].join('').substr(1);
- };
-
- var times = document.getElementsByTagName('time');
- for (var i = 0; i < times.length ; i++) {
- if(!times[i].textContent.match(/^\d+\/\d+\/\d+ \(\w+\) \d+:\d+:\d+$/)) {
- continue;
- }
-
- var t = iso8601(times[i].getAttribute('datetime'));
-
- times[i].textContent =
- // date
- zeropad(t.getMonth() + 1, 2) + "/" + zeropad(t.getDate(), 2) + "/" + t.getFullYear().toString().substring(2) +
- " (" + ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"][t.getDay()] + ") " +
- // time
- zeropad(t.getHours(), 2) + ":" + zeropad(t.getMinutes(), 2) + ":" + zeropad(t.getSeconds(), 2);
- }
-};
-{% endraw %}
-{% endif %}
-{% raw %}
-
function init() {
newElement = document.createElement('div');
newElement.className = 'styles';