(function () { 'use strict'; angular.module('streamApp').service('timeService', function () { this.getMinutes = function () { var minutes = []; var minute = ''; for (var i = 0; i < 60; i++) { minutes.push(i); } return minutes; }(); this.getHours = function () { var hours = []; var hour = ''; for (var i = 0; i < 24; i++) { hours.push(i); } return hours; }(); this.getRecordDate = function (date, hour, minute) { return ((new Date(date)).getTime()) + (hour * 60 + minute) * 60 * 1000; }; this.getDate = function(date) { return formatTime((date.getMonth() + 1)) + '/' + formatTime(date.getDate()) + '/' + date.getFullYear(); }; this.getDateFromString = function (dateString) { return dateString ? this.getDate(new Date(dateString)) : dateString; }; this.getOneYearFromDate = function (dateString) { let existingDate = new Date(dateString); existingDate.setFullYear(existingDate.getFullYear() + 1); return this.getDate(existingDate); }; }); })();