import { formatPlainTime } from "https://deno.land/x/complaindate@v0.7.2/utils/formatPlainTime.ts";
Curry a function to get localized strings of its plain-time arguments.
The function is curried in 2 rounds, each setting a property:
Intl
locale, defaults to system's locale if not given.Intl
format options, defaults to "medium" time-style if no options given.
Examples
Example 1
Example 1
const formatTime = formatPlainTime()(); // Use system's locale and default formatting options
const formatHour = formatPlainTime("en")({ hour: "numeric" });
formatTime(PlainTime({ hour: 13, minute: 37 })); // "1:37:00 PM"
formatHour(PlainTime({ hour: 13, minute: 37 })); // "1 PM"
Returns
(options?: FormatPlainTimeOptions) => (time: ComPlainTime) => string
A curried function that takes Intl
format options and returns the final curried function that operates on plain-times