salat-first
Version:
Islamic prayer times calculation with special support for Moroccan methods and Maliki madhab
61 lines (60 loc) • 1.46 kB
TypeScript
/**
* Rounding methods for prayer times
*/
export declare enum Rounding {
/**
* Round to the nearest minute
*/
Nearest = "nearest",
/**
* Always round up to the next minute
*/
Up = "up",
/**
* Do not round
*/
None = "none"
}
/**
* Time display formats
*/
export declare enum TimeFormat {
/**
* 24-hour format (e.g. "14:30")
*/
Hour24 = "hour24",
/**
* 12-hour format with AM/PM (e.g. "2:30 PM")
*/
Hour12 = "hour12"
}
/**
* Formats a date in 24-hour format
* @param date The date to format
* @returns The formatted time string
*/
export declare function format24Hour(date: Date): string;
/**
* Formats a date in 12-hour format with AM/PM
* @param date The date to format
* @returns The formatted time string
*/
export declare function format12Hour(date: Date): string;
/**
* Formats a date according to the specified format
* @param date The date to format
* @param format The time format to use
* @returns The formatted time string
*/
export declare function formatTime(date: Date, format?: TimeFormat): string;
/**
* Formats all prayer times according to the specified format
* @param times Object containing prayer times
* @param format The time format to use
* @returns Object with formatted prayer times
*/
export declare function formatPrayerTimes(times: {
[key: string]: Date;
}, format?: TimeFormat): {
[key: string]: string;
};