prayer_times

Configurable calculation package for Muslim prayer times in Elixir.

Installation

Add prayer_times to your list of dependencies in mix.exs:

def deps do
  [
    {:prayer_times, "~> 0.1.0"}
  ]
end

Usage

To obtain prayer times for a specific location and date:

PrayerTimes.compute(%{
  method: :turkiye,
  date: Date.utc_today,
  lat: 41.0082,
  long: 28.9784,
  timezone: 3
})

This will return a map with the prayer times as NaiveDateTime values, for example:

%{
  fajr: ~N[2023-11-22 06:21:00],
  sunrise: ~N[2023-11-22 07:53:00],
  dhuhr: ~N[2023-11-22 12:56:00],
  asr: ~N[2023-11-22 15:25:00],
  maghrib: ~N[2023-11-22 17:49:00],
  isha: ~N[2023-11-22 19:13:00],
  imsak: ~N[2023-11-22 06:13:00],
  midnight: ~N[2023-11-22 00:50:00],
  sunset: ~N[2023-11-22 17:40:00]
}

Parameters

Supported calculation methods: