UNPKG

@moveflow/widget

Version:

> ⚠️ **This is a testnet version** of the MoveFlow Checkout Widget. It is intended for development and testing purposes only. Do not use for mainnet payments.

22 lines (21 loc) 582 B
export const convertRateTypeToSeconds = (rateType) => { const intervals = [ { value: 1000 * 60 * 60 * 24, label: "day", }, { value: 1000 * 60 * 60 * 24 * 30, label: "month", }, { value: 1000 * 60 * 60 * 24 * 365, label: "year", }, ]; const selectedInterval = intervals.find((interval) => interval.label === rateType); if (selectedInterval) { return selectedInterval.value / 1000; // Convert milliseconds to seconds } return 0; };