Removes unused function "updateRelativeTimestamps"
@@ -84,28 +84,3 @@ export function relativeTime(now, previous) {
return labelGen(msPerYear, "year");
}
}
-
-/**
- * This utility function handles the whole setup of timers and generation of human
- * friendly, relative timestamps. You only need to bind them to your controller
- * (or scope) in the callback function. The callback is called once per minute
- * in accordance with the maximum granularity of our relative timestamps.
- *
- * @param $scope {object} the $scope injected into your controller
- * @param $interval {object} the $interval injected into your controller
- * @param creationDate {Date} the time stamp used as baseline of the relative timestamps
- * @param callback {function} it gets a string with a human readable, relative timestamp that you can
- * directly bind to your controller or scope in this callback.
- */
-export function updateRelativeTimestamps(
- $scope,
- $interval,
- creationDate,
- callback
-) {
- const updateTimeStamp = () =>
- callback(relativeTime(Date.now(), creationDate));
- updateTimeStamp(); //initial call for t=0
- const interval = $interval(updateTimeStamp, 60000);
- $scope.$on("$destroy", () => $interval.cancel(interval)); //clean up
-}
