title: Add time to date with angular
body: <p>In my Firebase I have:</p>
  
  <pre><code>Firebase generated date for a created day.
  
  Terms set by the user when the above was generated. 
  </code></pre>
  
  <p>So for example I have: </p>
  
  <pre><code>1439612582756 // formats to: Aug 14, 2015
  
  15 // Formats to: "Net 15" in my code 
  </code></pre>
  
  <p>My code looks like this:</p>
  
  <pre><code>&lt;td&gt;{{invoice.settings.created | date}}&lt;/td&gt;
  
  &lt;td&gt;{{invoice.settings.created + invoice.settings.terms | date}}&lt;/td&gt;
  </code></pre>
  
  <p>I have installed <code>moment.js</code> and 'angular-moment.js' to be able to format and play with dates, but I didn't see a way to add time to a date. This is for a for-each so I don't want to have to do any pre-scripting for this. Maybe a custom filter to add the terms to the date? </p>
  
  <p>Obviously, my code above does not function. I just made that to demonstrate what I am wanting. </p>
  
  <p>Any help would be appreciated!</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>Using this page: <code>http://momentjs.com/docs/#/durations/add/</code> I came up with this filter:</p>
  
  <pre><code>.filter('dateTerms', function() {
      return function(created, terms) {
          var a = moment.duration(created, 'd');
          var b = moment.duration(terms, 'd');
          return a.add(b).days();
      }
  })
  </code></pre>
  
  <p>But when I call it, I always end up with just <code>0</code>?</p>
  
  <pre><code>&lt;td&gt;{{invoice.settings.created | date}}&lt;/td&gt;
  &lt;td&gt;{{invoice.settings.terms | dateTerms}}&lt;/td&gt; // This line
  </code></pre>
  
  <p>I'm guessing it's because I'm only passing the filter the terms and not the created date. How would you pass two variables? I think I'm getting closer....</p>
  
  <p><strong>UPDATE 2</strong></p>
  
  <p>I dumped the moments crap. This is what I have now:</p>
  
  <pre><code>.filter('dateTerms', function() {
      return function(input, created) {
          var date = new Date(created*1000);
          date.setDate(date.getDate() + input);
          return (date.getMonth()+1)+'/'+ date.getDate() +'/'+date.getFullYear();
      }
  })
  </code></pre>
  
  <p>And then in my html:</p>
  
  <pre><code>&lt;td&gt;{{invoice.settings.terms | dateTerms:1439746291480}}&lt;/td&gt;
  
  1439746291480 converts to `Aug 16, 2015`
  </code></pre>
  
  <p>This results in: </p>
  
  <pre><code>8/24/47601
  </code></pre>