HOME


sh-3ll 1.0
DIR:/proc/self/root/proc/thread-self/cwd/assets/backend/plugins/moment/src/lib/moment/
Upload File :
Current File : //proc/self/root/proc/thread-self/cwd/assets/backend/plugins/moment/src/lib/moment/from.js
import { createDuration } from '../duration/create';
import { createLocal } from '../create/local';

export function from (time, withoutSuffix) {
    if (!this.isValid()) {
        return this.localeData().invalidDate();
    }
    return createDuration({to: this, from: time}).locale(this.locale()).humanize(!withoutSuffix);
}

export function fromNow (withoutSuffix) {
    return this.from(createLocal(), withoutSuffix);
}