Sha256: 9933983b131deaa91b5232c57bf476378fbb875a9d20edbea1ff254bd78725e7
Contents?: true
Size: 603 Bytes
Versions: 19
Compression:
Stored size: 603 Bytes
Contents
import { createDuration } from '../duration/create'; import { createLocal } from '../create/local'; import { isMoment } from '../moment/constructor'; export function to(time, withoutSuffix) { if ( this.isValid() && ((isMoment(time) && time.isValid()) || createLocal(time).isValid()) ) { return createDuration({ from: this, to: time }) .locale(this.locale()) .humanize(!withoutSuffix); } else { return this.localeData().invalidDate(); } } export function toNow(withoutSuffix) { return this.to(createLocal(), withoutSuffix); }
Version data entries
19 entries across 19 versions & 1 rubygems