kopia lustrzana https://github.com/dgtlmoon/changedetection.io
Show the date/time of the current/most up to date version
rodzic
f1c2ece32f
commit
c4197a5045
|
@ -244,6 +244,7 @@ def diff_history_page(uuid):
|
||||||
previous=previous_version_file_contents,
|
previous=previous_version_file_contents,
|
||||||
extra_stylesheets=extra_stylesheets,
|
extra_stylesheets=extra_stylesheets,
|
||||||
versions=dates[1:],
|
versions=dates[1:],
|
||||||
|
newest_version_timestamp=dates[0],
|
||||||
current_previous_version=str(previous_version),
|
current_previous_version=str(previous_version),
|
||||||
current_diff_url=watch['url'])
|
current_diff_url=watch['url'])
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
<input type="radio" name="diff_type" id="diffChars" value="diffChars"/> Chars</label>
|
<input type="radio" name="diff_type" id="diffChars" value="diffChars"/> Chars</label>
|
||||||
|
|
||||||
{% if versions|length >= 1 %}
|
{% if versions|length >= 1 %}
|
||||||
<label for="diff-version">Compare newest with</label>
|
<label for="diff-version">Compare newest (<span id="current-v-date"></span>) with</label>
|
||||||
<select id="diff-version" name="previous_version">
|
<select id="diff-version" name="previous_version">
|
||||||
{% for version in versions %}
|
{% for version in versions %}
|
||||||
<option value="{{version}}" {% if version== current_previous_version %} selected="" {% endif %}>
|
<option value="{{version}}" {% if version== current_previous_version %} selected="" {% endif %}>
|
||||||
|
@ -93,12 +93,16 @@ window.onload = function() {
|
||||||
var diffList=document.getElementById("diff-version");
|
var diffList=document.getElementById("diff-version");
|
||||||
if (typeof(diffList) != 'undefined' && diffList != null) {
|
if (typeof(diffList) != 'undefined' && diffList != null) {
|
||||||
for (var option of diffList.options) {
|
for (var option of diffList.options) {
|
||||||
//alert(option.value);
|
|
||||||
var dateObject = new Date(option.value*1000);
|
var dateObject = new Date(option.value*1000);
|
||||||
option.label=dateObject.toLocaleString();
|
option.label=dateObject.toLocaleString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Set current version date as local time in the browser also */
|
||||||
|
var current_v = document.getElementById("current-v-date");
|
||||||
|
var dateObject = new Date({{ newest_version_timestamp }}*1000);
|
||||||
|
current_v.innerHTML=dateObject.toLocaleString();
|
||||||
|
|
||||||
|
|
||||||
onDiffTypeChange(document.querySelector('#settings [name="diff_type"]:checked'));
|
onDiffTypeChange(document.querySelector('#settings [name="diff_type"]:checked'));
|
||||||
changed();
|
changed();
|
||||||
|
|
Ładowanie…
Reference in New Issue