From 7ea47f7ec8f8da556dc3a1760f339379733fce5c Mon Sep 17 00:00:00 2001
From: Jorrit Schaap <schaap@astron.nl>
Date: Tue, 27 Sep 2016 08:14:37 +0000
Subject: [PATCH] Task #9607: adapted custom timespan string

---
 .../lib/static/app/controllers/datacontroller.js          | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/SAS/ResourceAssignment/ResourceAssignmentEditor/lib/static/app/controllers/datacontroller.js b/SAS/ResourceAssignment/ResourceAssignmentEditor/lib/static/app/controllers/datacontroller.js
index bdf9c6d5245..647af631dac 100644
--- a/SAS/ResourceAssignment/ResourceAssignmentEditor/lib/static/app/controllers/datacontroller.js
+++ b/SAS/ResourceAssignment/ResourceAssignmentEditor/lib/static/app/controllers/datacontroller.js
@@ -1105,7 +1105,13 @@ dataControllerMod.controller('DataController',
         } else {
             var customZoomTimespan = $scope.zoomTimespans.find(function(zts) { return zts.name.startsWith('Custom'); });
             customZoomTimespan.value = viewTimeSpanInMinutes;
-            customZoomTimespan.name = 'Custom (' + viewTimeSpanInMinutes + ' min)';
+            if(viewTimeSpanInMinutes < 1440) {
+                customZoomTimespan.name = 'Custom (' + viewTimeSpanInMinutes + ' min)';
+            } else {
+                var viewTimeSpanInDays = Math.floor(viewTimeSpanInMinutes / 1440);
+                var viewTimeSpanReaminingMinutes = viewTimeSpanInMinutes - viewTimeSpanInDays * 1440;
+                customZoomTimespan.name = 'Custom (' + viewTimeSpanInDays  + ' days ' + viewTimeSpanReaminingMinutes + ' min)';
+            }
             $scope.zoomTimespan = customZoomTimespan;
         }
     };
-- 
GitLab