cal/packages/lib/findDurationType.ts
Omar López 7c749299bb
Enforces explicit type imports (#7158)
* Enforces explicit type imports

* Upgrades typescript-eslint

* Upgrades eslint related dependencies

* Update config

* Sync packages mismatches

* Syncs prettier version

* Linting

* Relocks node version

* Fixes

* Locks @vitejs/plugin-react to 1.3.2

* Linting
2023-02-16 15:39:57 -07:00

9 lines
341 B
TypeScript

import type { DurationType } from "./convertToNewDurationType";
import { MINUTES_IN_DAY, MINUTES_IN_HOUR } from "./convertToNewDurationType";
export default function findDurationType(value: number): DurationType {
if (value % MINUTES_IN_DAY === 0) return "days";
if (value % MINUTES_IN_HOUR === 0) return "hours";
return "minutes";
}