Advertisement
Guest User

Untitled

a guest
Apr 20th, 2014
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. <span am-time-ago="publishedAt"></span>
  2.  
  3. moment.lang('en', {
  4. relativeTime : {
  5. future: "in %s",
  6. past: "%s ago",
  7. s: "seconds",
  8. m: "1m",
  9. mm: "%m",
  10. h: "1h",
  11. hh: "%h",
  12. d: "1d",
  13. dd: "%dd",
  14. M: "1m",
  15. MM: "%dm",
  16. y: "1y",
  17. yy: "%dy"
  18. }
  19. });
  20.  
  21. x = new moment();
  22. z = x.clone().add('hours',1);
  23. x.from(z, false);
  24. >> 1h ago
  25. x.from(z, true) //no ago
  26. >> 1h
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement