Runkit
Runkit
home page
user forum
new notebook
clone notebook
download notebook
support & documentation
log in
sign up
new notebook
help & feedback
clone this notebook
download this notebook
Sign In
Sign Up
RunKit + npm: moment
node v13.14.0
endpoint
share
tweet
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…
Clone and edit this document