044cccb ←1090c6eantonApr 13, 2026 api

trashed from.js

? /sublimated/undefined +0 -20
1import { createDuration } from '../duration/create';
2import { createLocal } from '../create/local';
3import { isMoment } from '../moment/constructor';
4
5export function from(time, withoutSuffix) {
6 if (
7 this.isValid() &&
8 ((isMoment(time) && time.isValid()) || createLocal(time).isValid())
9 ) {
10 return createDuration({ to: this, from: time })
11 .locale(this.locale())
12 .humanize(!withoutSuffix);
13 } else {
14 return this.localeData().invalidDate();
15 }
16}
17
18export function fromNow(withoutSuffix) {
19 return this.from(createLocal(), withoutSuffix);
20}