Skip to content

Instantly share code, notes, and snippets.

View biswajitpanday's full-sized avatar
🎯
Focusing

Biswajit Panday biswajitpanday

🎯
Focusing
View GitHub Profile
@biswajitpanday
biswajitpanday / today-yesterday.filter.js
Created May 31, 2018 09:59
Fully customizable today, yesterday and date filter in angularjs.
.filter("timeago", function ($filter) {
//time: the time
//local: compared to what time? default: now
return function (time, local) {
if (!time)
return "never";
if (!local)
(local = Date.now())
if (angular.isDate(time))
time = time.getTime();