Advertisement
Guest User

TimeService.js

a guest
Aug 25th, 2016
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. angular.module('social-media-monitor').service("TimeService", function () {
  2.  
  3.  
  4.     var service = this;
  5.  
  6.  
  7.     service.getFormattedTime = function (x) {
  8.  
  9.         return moment(x).format('HH:mm');
  10.  
  11.     };
  12.  
  13.  
  14.     service.getDate = function (dataArray, i) {
  15.         if (dataArray != null) {
  16.             if (!dataArray.length) {
  17.                 console.info('not found', i, dataArray);
  18.                 return 0;
  19.             }
  20.             return dataArray[i - 1].date;
  21.         }
  22.         return 0;
  23.     };
  24.  
  25. })
  26. ;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement