Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
calcTimes() {
let coordinates = new adhan.Coordinates(this.state.lat, this.state.lon)
let today = new Date()
let tomorrow = new Date()
tomorrow.setDate(today.getDate()+1)
var params = adhan.CalculationMethod.MoonsightingCommittee()
let prayerTimesToday = new adhan.PrayerTimes(coordinates, today, params)
let prayerTimesTomorrow = new adhan.PrayerTimes(coordinates, tomorrow, params)
console.log(prayerTimesTomorrow)
let maghrib = dayjs(prayerTimesToday.maghrib)
let fajr = dayjs(prayerTimesTomorrow.fajr)
console.log(maghrib)
console.log(fajr)
let interval = fajr.diff(maghrib, 'millisecond') / 6
console.log(interval)
let times = []
for (let i = 0; i < 7; i++) {
times.push(maghrib.add(interval * i, 'millisecond'))
}
console.log(times)
let timeFormat = "h:mm a"
this.setState({
calcTimes() {
let coordinates = new adhan.Coordinates(this.state.lat, this.state.lon)
let today = new Date()
let tomorrow = new Date()
tomorrow.setDate(today.getDate()+1)
var params = adhan.CalculationMethod.MoonsightingCommittee()
let prayerTimesToday = new adhan.PrayerTimes(coordinates, today, params)
let prayerTimesTomorrow = new adhan.PrayerTimes(coordinates, tomorrow, params)
console.log(prayerTimesTomorrow)
let maghrib = dayjs(prayerTimesToday.maghrib)
let fajr = dayjs(prayerTimesTomorrow.fajr)
console.log(maghrib)
console.log(fajr)
let interval = fajr.diff(maghrib, 'millisecond') / 6
console.log(interval)
let times = []
for (let i = 0; i < 7; i++) {
times.push(maghrib.add(interval * i, 'millisecond'))
}
console.log(times)
let timeFormat = "h:mm a"
calcTimes() {
let coordinates = new adhan.Coordinates(this.state.lat, this.state.lon)
let today = new Date()
let tomorrow = new Date()
tomorrow.setDate(today.getDate()+1)
var params = adhan.CalculationMethod.MoonsightingCommittee()
let prayerTimesToday = new adhan.PrayerTimes(coordinates, today, params)
let prayerTimesTomorrow = new adhan.PrayerTimes(coordinates, tomorrow, params)
console.log(prayerTimesTomorrow)
let maghrib = dayjs(prayerTimesToday.maghrib)
let fajr = dayjs(prayerTimesTomorrow.fajr)
console.log(maghrib)
console.log(fajr)
let interval = fajr.diff(maghrib, 'millisecond') / 6
console.log(interval)
let times = []
calcTimes() {
let coordinates = new adhan.Coordinates(this.state.lat, this.state.lon)
let today = new Date()
let tomorrow = new Date()
tomorrow.setDate(today.getDate()+1)
var params = adhan.CalculationMethod.MoonsightingCommittee()
let prayerTimesToday = new adhan.PrayerTimes(coordinates, today, params)
let prayerTimesTomorrow = new adhan.PrayerTimes(coordinates, tomorrow, params)
console.log(prayerTimesTomorrow)
let maghrib = dayjs(prayerTimesToday.maghrib)
let fajr = dayjs(prayerTimesTomorrow.fajr)
console.log(maghrib)
console.log(fajr)
let interval = fajr.diff(maghrib, 'millisecond') / 6
console.log(interval)
let times = []
for (let i = 0; i < 7; i++) {
times.push(maghrib.add(interval * i, 'millisecond'))
}
console.log(times)
const MethodSelect = ({ value, onChange }) => (
<select value="{value}">
{
Object.keys(adhan.CalculationMethod).map(method => (
<option value="{method}">{method.replace(/([a-z\d])([A-Z])/g, `$1 $2`)}</option>
))
}
</select>
);
const MadhabSelect = ({ onChange, value }) => (
<select id="prayerMethod" value="{value}">
{
Object.keys(adhan.Madhab).map(method => (
<option value="{method}">{method}</option>
))
}
</select>
);