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:
Henne Vogelsang 2024-03-05 15:30:53 +01:00
parent 9fd0807a9a
commit b6560dbb34
659 changed files with 129299 additions and 67 deletions

View 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);
}