pray-calc/.github/wiki/api/functions/calcTimes.md
Aric Camarata 4227afc2c3 docs: add TypeDoc API generation (typedoc@0.28.19 + typedoc-plugin-markdown@4.11.0)
Add typedoc and typedoc-plugin-markdown as devDependencies. Add typedoc.json config
targeting src/index.ts with markdown output to .github/wiki/api. Add docs script to
package.json. Generate initial API reference pages.

Part of T-E8-03 — TypeDoc automation for all 12 JS/TS packages.
2026-05-30 16:41:58 -04:00

1.5 KiB

pray-calc v2.1.1


pray-calc / calcTimes

Function: calcTimes()

calcTimes(date, lat, lng, tz?, elevation?, temperature?, pressure?, hanafi?): FormattedPrayerTimes

Defined in: calcTimes.ts:30

Compute prayer times formatted as HH:MM:SS strings.

Uses the dynamic twilight angle algorithm. See getTimes() for full parameter documentation.

Parameters

date

Date

Observer's local date

lat

number

Latitude in decimal degrees (-90 to 90)

lng

number

Longitude in decimal degrees (-180 to 180)

tz?

number = ...

UTC offset in hours (default: system timezone)

elevation?

number = 0

Elevation in meters (default: 0)

temperature?

number = 15

Temperature in Celsius (default: 15)

pressure?

number = 1013.25

Pressure in mbar/hPa (default: 1013.25)

hanafi?

boolean = false

Hanafi Asr convention (default: false)

Returns

FormattedPrayerTimes

Prayer times as HH:MM:SS strings. Returns "N/A" for any time that cannot be computed (polar night, unreachable angle, etc.).

Example

const times = calcTimes(new Date('2024-06-21'), 40.7128, -74.006, -4);
console.log(times.Fajr);    // "03:51:24"
console.log(times.Maghrib); // "20:31:17"