corrade-nucleus-nucleons – Blame information for rev 38
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
38 | office | 1 | import { createDuration } from '../duration/create'; |
2 | import { createLocal } from '../create/local'; |
||
3 | import { isMoment } from '../moment/constructor'; |
||
4 | |||
5 | export function from (time, withoutSuffix) { |
||
6 | if (this.isValid() && |
||
7 | ((isMoment(time) && time.isValid()) || |
||
8 | createLocal(time).isValid())) { |
||
9 | return createDuration({to: this, from: time}).locale(this.locale()).humanize(!withoutSuffix); |
||
10 | } else { |
||
11 | return this.localeData().invalidDate(); |
||
12 | } |
||
13 | } |
||
14 | |||
15 | export function fromNow (withoutSuffix) { |
||
16 | return this.from(createLocal(), withoutSuffix); |
||
17 | } |