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

Function from

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

Source from the content-addressed store, hash-verified

3977 }
3978
3979 function from(time, withoutSuffix) {
3980 if (
3981 this.isValid() &&
3982 ((isMoment(time) && time.isValid()) || createLocal(time).isValid())
3983 ) {
3984 return createDuration({ to: this, from: time })
3985 .locale(this.locale())
3986 .humanize(!withoutSuffix);
3987 } else {
3988 return this.localeData().invalidDate();
3989 }
3990 }
3991
3992 function fromNow(withoutSuffix) {
3993 return this.from(createLocal(), withoutSuffix);

Callers

nothing calls this directly

Calls 3

isMomentFunction · 0.85
createLocalFunction · 0.85
createDurationFunction · 0.85

Tested by

no test coverage detected