RunKit + npm: moment

node v13.14.0
endpointsharetweet
var dayjs = require("dayjs") dayjs.extend(require("dayjs/plugin/calendar")) dayjs.extend(require("dayjs/plugin/relativeTime")) console.log(dayjs('2020-03-01').calendar('2020-03-02')) console.log(dayjs('2020-03-01').from('2020-03-02')) console.log('====') console.log(dayjs('2020-03-03').calendar('2020-03-02')) console.log(dayjs('2020-03-03').from('2020-03-02'))
Created from: https://npm.runkit.com/moment
Loading…