batoulapps / adhan-js

High precision Islamic prayer time library for JavaScript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Rounding Behaviour

farisfaisalthena opened this issue ยท comments

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);

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.

๐ŸŽ‰ This issue has been resolved in version 4.2.1 ๐ŸŽ‰

The release is available on:

Your semantic-release bot ๐Ÿ“ฆ๐Ÿš€