mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-08-14 02:26:58 -07:00
Fix bug on graph tooltips where some values were incorrectly converted to dates.
Format the header on the history modal to human readable date.
This commit is contained in:
parent
d71e12ea6e
commit
9564c5ed81
2 changed files with 9 additions and 13 deletions
|
@ -190,7 +190,7 @@
|
|||
success: function(data) {
|
||||
var dateArray = [];
|
||||
for (var i = 0; i < data.categories.length; i++) {
|
||||
dateArray.push(moment(data.categories[i]).valueOf());
|
||||
dateArray.push(moment(data.categories[i], 'YYYY-MM-DD').valueOf());
|
||||
}
|
||||
hc_plays_by_day_options.yAxis.min = 0;
|
||||
hc_plays_by_day_options.xAxis.categories = dateArray;
|
||||
|
@ -264,7 +264,7 @@
|
|||
success: function(data) {
|
||||
var dateArray = [];
|
||||
for (var i = 0; i < data.categories.length; i++) {
|
||||
dateArray.push(moment(data.categories[i]).valueOf());
|
||||
dateArray.push(moment(data.categories[i], 'YYYY-MM').valueOf());
|
||||
}
|
||||
hc_plays_by_month_options.yAxis.min = 0;
|
||||
hc_plays_by_month_options.xAxis.categories = dateArray;
|
||||
|
@ -311,8 +311,8 @@
|
|||
hc_plays_by_month_options.yAxis.labels.formatter = yaxis_format;
|
||||
|
||||
tooltip_format = function() {
|
||||
if (moment(this.x).isValid()) {
|
||||
var s = '<b>'+ moment(this.x).format("ddd MMM D") +'</b>';
|
||||
if (moment(this.x, 'X').isValid() && (this.x > 946684800)) {
|
||||
var s = '<b>'+ moment(this.x, 'X').format("ddd MMM D") +'</b>';
|
||||
} else {
|
||||
var s = '<b>'+ this.x +'</b>';
|
||||
}
|
||||
|
@ -344,8 +344,8 @@
|
|||
hc_plays_by_month_options.yAxis.labels.formatter = yaxis_format;
|
||||
|
||||
tooltip_format = function() {
|
||||
if (moment(this.x).isValid()) {
|
||||
var s = '<b>'+ moment(this.x).format("ddd MMM D") +'</b>';
|
||||
if (moment(this.x, 'X').isValid() && (this.x > 946684800)) {
|
||||
var s = '<b>'+ moment(this.x, 'X').format("ddd MMM D") +'</b>';
|
||||
} else {
|
||||
var s = '<b>'+ this.x +'</b>';
|
||||
}
|
||||
|
@ -356,12 +356,7 @@
|
|||
return s;
|
||||
}
|
||||
stack_labels_format = function() {
|
||||
if (moment(this.total).isValid()) {
|
||||
console.log(this);
|
||||
var s = moment.duration(this.total, 'seconds').format("H [hrs] m [mins]");
|
||||
} else {
|
||||
var s = this.total;
|
||||
}
|
||||
var s = moment.duration(this.total, 'seconds').format("H [hrs] m [mins]");
|
||||
return s;
|
||||
}
|
||||
hc_plays_by_day_options.tooltip.formatter = tooltip_format;
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"><i class="fa fa-remove"></i></button>
|
||||
<h4 class="modal-title" id="myModalLabel">
|
||||
<strong><span id="modal_header_ip_address">
|
||||
<i class="fa fa-history"></i> History for ${data}
|
||||
<i class="fa fa-history"></i> History for <span id="date-header">${data}</span>
|
||||
</span></strong>
|
||||
</h4>
|
||||
</div>
|
||||
|
@ -31,6 +31,7 @@
|
|||
<script src="interfaces/default/js/tables/history_table_modal.js"></script>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('#date-header').html(moment('${data}','YYYY-MM-DD').format('ddd MMM Do YYYY'));
|
||||
history_table_modal_options.ajax = {
|
||||
"url": "get_history",
|
||||
type: "post",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue