Get off off rails-assets
Just moving the things we currently use (and should drop in the ASAP) to vendor/assets
This commit is contained in:
parent
9fd0807a9a
commit
b6560dbb34
659 changed files with 129299 additions and 67 deletions
20
vendor/assets/javascripts/momentjs/src/lib/moment/from.js
vendored
Normal file
20
vendor/assets/javascripts/momentjs/src/lib/moment/from.js
vendored
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
import { createDuration } from '../duration/create';
|
||||
import { createLocal } from '../create/local';
|
||||
import { isMoment } from '../moment/constructor';
|
||||
|
||||
export function from(time, withoutSuffix) {
|
||||
if (
|
||||
this.isValid() &&
|
||||
((isMoment(time) && time.isValid()) || createLocal(time).isValid())
|
||||
) {
|
||||
return createDuration({ to: this, from: time })
|
||||
.locale(this.locale())
|
||||
.humanize(!withoutSuffix);
|
||||
} else {
|
||||
return this.localeData().invalidDate();
|
||||
}
|
||||
}
|
||||
|
||||
export function fromNow(withoutSuffix) {
|
||||
return this.from(createLocal(), withoutSuffix);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue