Git Product home page Git Product logo

prayertime's People

Contributors

buildscientist avatar

Watchers

 avatar  avatar

prayertime's Issues

High latitude calculations for one seventh are invalid

Prayer time calculations for cities that have high latitudes (e.g. Helsinki, Finland) are invalid when using a high latitude calculation option of one seventh.

Example:

	var helsinki = praytime.New(60.192059, 24.945831, 3)
	helsinki.AdjustHighLats = praytime.ONE_SEVENTH
	var helsinkiPrayerTime = praytime.CalculatePrayerTimes(&helsinki, time.Now())

Output:

=======Helsinki=======
September 21 2017
fajr - 04:31
sunrise - 07:00
dhuhr - 13:13
asr - 16:29
sunset - 19:30
maghrib - 19:30
isha - 21:50

According to alternative Prayer time calculators both Fajr and Isha should be offset by 52 and 47 minutes respectively.

Prep for upcoming vendoring support

Module vendoring will be introduced with GoLang v1.12. While prayertime was written with GoLang v1.7.x the library should be vendored accordingly such that users will be able to use it with vgo/go mod.

Refactor code to support interfaces

The prayertime module contains a PrayerLocale struct and a set of functions that you pass a reference to a PrayerLocale struct to.

Interfaces should be used instead as this makes the code cleaner and composable. This would purely be considered a refactor as the underlying functionality of the API should not change.

Makkah prayercalc method is undefined

When using praytime.MAKKAH as a prayer calculation method - Isha prayer times are undefined.

	var toronto = praytime.New(43.6532, -79.3832, -4.0)
	toronto.PrayerCalcMethod = praytime.MAKKAH
	var torontoPrayerTime = praytime.CalculatePrayerTimes(&toronto, time.Now())

Output is:

=======Toronto=======
September 21 2017
fajr - 05:23
sunrise - 07:03
dhuhr - 13:10
asr - 17:30
sunset - 19:20
maghrib - 19:20
isha - -----

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.