UNPKG

convertible-js

Version:

Convert 12-hour time string to 24-hour time and vice versa with flexible formatting.

14 lines (13 loc) 723 B
import { Hours, Minutes } from './custom-types'; interface TimeComponents { hours: Hours; minutes: Minutes; period?: string | null; secondsAndMilleseconds?: string; } export declare const customTimeFormat: ({ hours, minutes, period }: TimeComponents, desiredFormat: string) => string; export declare const defaultTimeFormat: ({ hours, minutes, period, secondsAndMilleseconds }: TimeComponents) => string; export declare const getHoursFrom12HoursTime: (hours: string | number, period: string | null) => string | number; export declare const getHoursFrom24HoursTime: (hours: string | number) => string | number; export declare const getTimePeriodFrom24HourTime: (hours: string | number) => string; export {};