Moment duration

Source: https://stackoverflow.com/questions/18623783/get-the-time-difference-between-two-datetimes/34672015

moment.duration(now.diff(then)).humanize()


public getDurationText(date1, date2) {
if (!date1) {
return '';
}
// check null date2 (is current date)
const date2Tmp = date2 ? date2 : new Date();
// return
return moment.duration(moment(date2Tmp).diff(moment(date1))).humanize();
}

Không có nhận xét nào:

Cold Turkey Blocker

 https://superuser.com/questions/1366153/how-to-get-rid-of-cold-turkey-website-blocker-get-around-the-block Very old question, but still wan...