diff --git a/data/interfaces/default/graphs.html b/data/interfaces/default/graphs.html index ade1e6ac..bc234861 100644 --- a/data/interfaces/default/graphs.html +++ b/data/interfaces/default/graphs.html @@ -458,12 +458,8 @@ data: { y_axis: yaxis }, dataType: "json", success: function(data) { - var dateArray = []; - for (var i = 0; i < data.categories.length; i++) { - dateArray.push(moment(data.categories[i], 'YYYY-MM').format('MMM YYYY')); - } hc_plays_by_month_options.yAxis.min = 0; - hc_plays_by_month_options.xAxis.categories = dateArray; + hc_plays_by_month_options.xAxis.categories = data.categories; hc_plays_by_month_options.series = data.series; var hc_plays_by_month = new Highcharts.Chart(hc_plays_by_month_options); } diff --git a/data/interfaces/default/home_stats.html b/data/interfaces/default/home_stats.html index b4b9e600..3e65a5ef 100644 --- a/data/interfaces/default/home_stats.html +++ b/data/interfaces/default/home_stats.html @@ -41,6 +41,22 @@ platform_type Returns the platform name for the associated stat. DOCUMENTATION :: END +<%! + from plexpy import helpers + + # Human readable duration + def hd(minutes): + if int(minutes) > 60: + hours = int(helpers.cast_to_float(minutes) / 60) + minutes = int(helpers.cast_to_float(minutes) % hours) + if minutes > 0: + return "

" + str(hours) + "

hrs

" + str(minutes) + "

mins

" + else: + return "

" + str(hours) + "

hrs

" + else: + return "

" + minutes + "

mins

" +%> + % if data: % if data[0]['rows'] or data[2]['rows']: