1 import { createDuration } from '../duration/create';
2 import { createLocal } from '../create/local';
3 import { isMoment } from '../moment/constructor';
5 export function to (time, withoutSuffix) {
7 ((isMoment(time) && time.isValid()) ||
8 createLocal(time).isValid())) {
9 return createDuration({from: this, to: time}).locale(this.locale()).humanize(!withoutSuffix);
11 return this.localeData().invalidDate();
15 export function toNow (withoutSuffix) {
16 return this.to(createLocal(), withoutSuffix);