MCPcopy Index your code
hub / github.com/MALSync/MALSync / durationToMs

Method durationToMs

src/utils/IntlWrapper.ts:132–142  ·  view source on GitHub ↗
(input: DurationFormat)

Source from the content-addressed store, hash-verified

130 }
131
132 static durationToMs(input: DurationFormat): number {
133 const keys = Object.keys(input);
134 let timestamp = 0;
135 if (keys.length <= 0) return timestamp;
136 for (let i = 0; i < keys.length; i++) {
137 const key = keys[i];
138 const value = input[key];
139 timestamp += dateUnitToMs[key] * value;
140 }
141 return timestamp || 0;
142 }
143
144 getRelativeText(options: DurationFormatOptions = { style: 'narrow' }): string {
145 if (!this.duration) return '';

Callers 3

setDurationFormattedMethod · 0.80
checkForNowFunction · 0.80

Calls 1

keysMethod · 0.80

Tested by

no test coverage detected