stankovski / prayer-times Goto Github PK
View Code? Open in Web Editor NEWC# library to calculate Muslim prayer times
License: MIT License
C# library to calculate Muslim prayer times
License: MIT License
Asalamu alaikum wa rahmatullahi wa barakatu akhi,
The line :
if (this.HighLatitudeAdjustmentMethod == HighLatitudeAdjustmentMethods.AngleBased)
return 1 / 60 * angle;
Should be :
if (this.HighLatitudeAdjustmentMethod == HighLatitudeAdjustmentMethods.AngleBased)
return 1d / 60d * angle;
Without this, the fraction returns 0 ( as it does integer division and returns a whole number), by setting the values to doubles a fraction is returned and angle based calculations work correctly.
Jazakallahu khairan for your good work.
Nad
This is not real Muslim times. The times are not correct.
Salam aleykum
Please check the "EffectiveTimeZone()" in "PrayerTimesCalculator"
it should be like that
private int EffectiveTimeZone(DateTimeOffset date, int? timeZone)
{
if (timeZone == null)
timeZone = date.Offset.Hours;
int dstOffset = 0;
if (date.LocalDateTime.IsDaylightSavingTime())
{
dstOffset = -1;
}
return timeZone.Value - dstOffset;
}
CalculationMethods.Custom can be used, but the values for this are hard-coded and the same as the Muslim World League, making it useless. Additional properties should be used to allow any custom angles to be used.
try this test..
PrayerTimesCalculator calc = new PrayerTimesCalculator(53.4794892, -2.2451148);
calc.CalculationMethod = CalculationMethods.MWL;
calc.AsrJurusticMethod = AsrJuristicMethods.Shafii;
var times = calc.GetPrayerTimes(new DateTime(2020, 5, 14), 1);
it will return NaN for FAJR time.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.