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:

Is there a way to chain multiple tailwind css classes on a single hover instance?

 https://stackoverflow.com/questions/73524088/is-there-a-way-to-chain-multiple-tailwind-css-classes-on-a-single-hover-instance There is a wa...