From 3cf945146d2b6c37718ed3fbbbb6c4fd38839a37 Mon Sep 17 00:00:00 2001 From: "E.Smith" <31170571+azlm8t@users.noreply.github.com> Date: Wed, 19 Sep 2018 19:43:05 +0100 Subject: [PATCH] ui: Add grouping format specifier for dates. When grouping recordings by datetime, each group tends to only have one recording since time field is unique. So, when grouping, we only use the date-portion and not the time portion in order to create the group. --- src/webui/static/app/idnode.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/webui/static/app/idnode.js b/src/webui/static/app/idnode.js index 673a18b50..6fa2a0dae 100644 --- a/src/webui/static/app/idnode.js +++ b/src/webui/static/app/idnode.js @@ -339,6 +339,21 @@ tvheadend.IdNodeField = function(conf) props.renderer = Ext.ux.grid.CheckColumn.prototype.renderer; } + // Special handling for date/time fields. + if (ftype == 'date') + { + // When grouping, only use date and do not include + // timestamp, otherwise when grouping recordings, you can + // get hundreds of groups, each containing one recording. + // This format is for group section titles only, and not + // for normal display of dates nor for the display of + // dates inside of a group. + props.groupRenderer = function(v, m, r) { + var date = new Date(v*1000); + return date.toLocaleString(tvheadend.toLocaleFormat(), {weekday: 'short', day: 'numeric', month: 'long', year: 'numeric'}); + } + }; + return props; }; -- 2.47.2