MCPcopy Create free account
hub / github.com/scottrogowski/code2flow / to

Function to

tests/test_code/js/moment/moment.js:3996–4007  ·  view source on GitHub ↗
(time, withoutSuffix)

Source from the content-addressed store, hash-verified

3994 }
3995
3996 function to(time, withoutSuffix) {
3997 if (
3998 this.isValid() &&
3999 ((isMoment(time) && time.isValid()) || createLocal(time).isValid())
4000 ) {
4001 return createDuration({ from: this, to: time })
4002 .locale(this.locale())
4003 .humanize(!withoutSuffix);
4004 } else {
4005 return this.localeData().invalidDate();
4006 }
4007 }
4008
4009 function toNow(withoutSuffix) {
4010 return this.to(createLocal(), withoutSuffix);

Callers

nothing calls this directly

Calls 3

isMomentFunction · 0.85
createLocalFunction · 0.85
createDurationFunction · 0.85

Tested by

no test coverage detected