MCPcopy
hub / github.com/valor-software/ngx-bootstrap / from

Function from

src/chronos/moment/from.ts:6–21  ·  view source on GitHub ↗
(date: Date, time: Date, withoutSuffix, config: DateParsingConfig)

Source from the content-addressed store, hash-verified

4
5// todo: implement
6export function from(date: Date, time: Date, withoutSuffix, config: DateParsingConfig): string {
7 if (isDateValid(date) && isDateValid(time)) {
8 createDuration({ to: date, from: time });
9
10 return 'todo: implement';
11 }
12
13 return 'not valid date';
14 // if (this.isValid() &&
15 // ((isMoment(time) && time.isValid()) ||
16 // createLocal(time).isValid())) {
17 // return createDuration({ to: this, from: time }).locale(this.locale()).humanize(!withoutSuffix);
18 // } else {
19 // return this.localeData().invalidDate();
20 // }
21}
22
23// export function fromNow(withoutSuffix) {
24// return this.from(createLocal(), withoutSuffix);

Callers 1

syncActionsMethod · 0.85

Calls 2

isDateValidFunction · 0.90
createDurationFunction · 0.90

Tested by

no test coverage detected