Browse Source

Support informal time zones.

pull/287/head
Pēteris Caune 5 years ago
parent
commit
9474006d83
No known key found for this signature in database GPG Key ID: E28D7679E9A9EDE2
7 changed files with 17 additions and 12 deletions
  1. +5
    -4
      static/js/details.js
  2. +6
    -5
      static/js/log.js
  3. +1
    -0
      static/js/moment-timezone-with-data-10-year-range.min.js
  4. +1
    -0
      static/js/moment.min.js
  5. +0
    -1
      static/js/spacetime.min.js
  6. +2
    -1
      templates/front/details.html
  7. +2
    -1
      templates/front/log.html

+ 5
- 4
static/js/details.js View File

@ -109,11 +109,12 @@ $(function () {
var lastFormat = "local"; var lastFormat = "local";
function switchDateFormat(format) { function switchDateFormat(format) {
lastFormat = format; lastFormat = format;
var tz = format == "local" ? spacetime().timezone().name : format;
$("#log tr").each(function(index, row) { $("#log tr").each(function(index, row) {
var s = spacetime(row.getAttribute("data-dt")).goto(tz);
$(".date", row).text(s.unixFmt("MMM d"));
$(".time", row).text(s.unixFmt("h:mm"));
var dt = moment(row.getAttribute("data-dt"));
format == "local" ? dt.local() : dt.tz(format);
$(".date", row).text(dt.format("MMM D"));
$(".time", row).text(dt.format("HH:mm"));
}) })
// The table is initially hidden to avoid flickering as we convert dates. // The table is initially hidden to avoid flickering as we convert dates.


+ 6
- 5
static/js/log.js View File

@ -11,12 +11,13 @@ $(function () {
}); });
function switchDateFormat(format) { function switchDateFormat(format) {
var tz = format == "local" ? spacetime().timezone().name : format;
$("#log tr").each(function(index, row) { $("#log tr").each(function(index, row) {
var s = spacetime(row.getAttribute("data-dt")).goto(tz);
$(".date", row).text(s.unixFmt("MMM d"));
$(".time", row).text(s.unixFmt("h:mm"));
})
var dt = moment(row.getAttribute("data-dt"));
format == "local" ? dt.local() : dt.tz(format);
$(".date", row).text(dt.format("MMM D"));
$(".time", row).text(dt.format("HH:mm"));
})
} }
$("#format-switcher").click(function(ev) { $("#format-switcher").click(function(ev) {


+ 1
- 0
static/js/moment-timezone-with-data-10-year-range.min.js
File diff suppressed because it is too large
View File


+ 1
- 0
static/js/moment.min.js
File diff suppressed because it is too large
View File


+ 0
- 1
static/js/spacetime.min.js
File diff suppressed because it is too large
View File


+ 2
- 1
templates/front/details.html View File

@ -262,7 +262,8 @@
<script src="{% static 'js/bootstrap-select.min.js' %}"></script> <script src="{% static 'js/bootstrap-select.min.js' %}"></script>
<script src="{% static 'js/nouislider.min.js' %}"></script> <script src="{% static 'js/nouislider.min.js' %}"></script>
<script src="{% static 'js/snippet-copy.js' %}"></script> <script src="{% static 'js/snippet-copy.js' %}"></script>
<script src="{% static 'js/spacetime.min.js' %}"></script>
<script src="{% static 'js/moment.min.js' %}"></script>
<script src="{% static 'js/moment-timezone-with-data-10-year-range.min.js' %}"></script>
<script src="{% static 'js/update-timeout-modal.js' %}"></script> <script src="{% static 'js/update-timeout-modal.js' %}"></script>
<script src="{% static 'js/adaptive-setinterval.js' %}"></script> <script src="{% static 'js/adaptive-setinterval.js' %}"></script>
<script src="{% static 'js/details.js' %}"></script> <script src="{% static 'js/details.js' %}"></script>


+ 2
- 1
templates/front/log.html View File

@ -171,7 +171,8 @@
{% compress js %} {% compress js %}
<script src="{% static 'js/jquery-2.1.4.min.js' %}"></script> <script src="{% static 'js/jquery-2.1.4.min.js' %}"></script>
<script src="{% static 'js/bootstrap.min.js' %}"></script> <script src="{% static 'js/bootstrap.min.js' %}"></script>
<script src="{% static 'js/spacetime.min.js' %}"></script>
<script src="{% static 'js/moment.min.js' %}"></script>
<script src="{% static 'js/moment-timezone-with-data-10-year-range.min.js' %}"></script>
<script src="{% static 'js/log.js' %}"></script> <script src="{% static 'js/log.js' %}"></script>
{% endcompress %} {% endcompress %}
{% endblock %} {% endblock %}

Loading…
Cancel
Save