MCPcopy
hub / github.com/msgbyte/tianji / getAllowedUnits

Function getAllowedUnits

src/server/utils/common.ts:219–225  ·  view source on GitHub ↗
(startDate: Date, endDate: Date)

Source from the content-addressed store, hash-verified

217}
218
219export function getAllowedUnits(startDate: Date, endDate: Date) {
220 const units = ['minute', 'hour', 'day', 'month', 'year'];
221 const minUnit = getMinimumUnit(startDate, endDate);
222 const index = units.indexOf(minUnit);
223
224 return index >= 0 ? units.splice(index) : [];
225}
226
227/**
228 * fork from https://github.com/mcnaveen/numify/blob/main/src/index.ts

Callers 1

parseDateRangeFunction · 0.85

Calls 1

getMinimumUnitFunction · 0.90

Tested by

no test coverage detected