batoulapps / adhan-js

High precision Islamic prayer time library for JavaScript
MIT License
388 stars 87 forks source link

Rounding Behaviour #68

Closed farisfaisalthena closed 3 years ago

farisfaisalthena commented 3 years ago

Hi may i know how to implement this rounding behaviour? Because i get an error saying its undefined

Cannot read property 'Nearest' of undefined
TypeError: Cannot read property 'Nearest' of undefined

Here's my implementation

 const coordinates = new adhan.Coordinates(res.coords.latitude, res.coords.longitude);
 const date = new Date();
 const params = adhan.CalculationMethod.Singapore();
 params.rounding = adhan.Rounding.Nearest;

 this.time = new adhan.PrayerTimes(coordinates, date, params);
z3bi commented 3 years ago

The Singapore method will automatically use the new correct rounding.

But it does look like I forgot to add Rounding to the adhan export to make it available for overriding. I will submit a new update shortly that fixes that.

github-actions[bot] commented 3 years ago

:tada: This issue has been resolved in version 4.2.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket: