7c749299bb
* 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
9 lines
341 B
TypeScript
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";
|
|
}
|