local-time.js changes from 65f39b8a07
and c21eeff605
This commit is contained in:
parent
19e6658bc1
commit
da6eb9e2cb
@ -73,7 +73,7 @@ $(document).ready(function(){
|
|||||||
|
|
||||||
times[i].setAttribute('data-local', 'true');
|
times[i].setAttribute('data-local', 'true');
|
||||||
|
|
||||||
if (!localStorage.show_relative_time || localStorage.show_relative_time === 'false') {
|
if (localStorage.show_relative_time === 'false') {
|
||||||
times[i].innerHTML = dateformat(iso8601(t));
|
times[i].innerHTML = dateformat(iso8601(t));
|
||||||
times[i].setAttribute('title', timeDifference(currentTime, postTime.getTime()));
|
times[i].setAttribute('title', timeDifference(currentTime, postTime.getTime()));
|
||||||
} else {
|
} else {
|
||||||
@ -89,7 +89,7 @@ $(document).ready(function(){
|
|||||||
Options.extend_tab('general', '<label id="show-relative-time"><input type="checkbox">' + _('Show relative time') + '</label>');
|
Options.extend_tab('general', '<label id="show-relative-time"><input type="checkbox">' + _('Show relative time') + '</label>');
|
||||||
|
|
||||||
$('#show-relative-time>input').on('change', function() {
|
$('#show-relative-time>input').on('change', function() {
|
||||||
if (localStorage.show_relative_time === 'true') {
|
if (localStorage.show_relative_time !== 'false') {
|
||||||
localStorage.show_relative_time = 'false';
|
localStorage.show_relative_time = 'false';
|
||||||
clearInterval(interval_id);
|
clearInterval(interval_id);
|
||||||
} else {
|
} else {
|
||||||
@ -100,7 +100,7 @@ $(document).ready(function(){
|
|||||||
do_localtime(document);
|
do_localtime(document);
|
||||||
});
|
});
|
||||||
|
|
||||||
if (localStorage.show_relative_time === 'true') {
|
if (localStorage.show_relative_time !== 'false') {
|
||||||
$('#show-relative-time>input').attr('checked','checked');
|
$('#show-relative-time>input').attr('checked','checked');
|
||||||
interval_id = setInterval(do_localtime, 30000, document);
|
interval_id = setInterval(do_localtime, 30000, document);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user