Avatar

shaya

2 public vals
Joined January 12, 2023
1
2
3
4
5
6
7
8
9
10
11
12
13
import { fetch } from "https://esm.town/v/std/fetch";
export async function getSofZmanShma(city) {
console.log({ city });
const today = new Date().toISOString().split("T")[0];
const data = await (
await fetch(
`https://www.hebcal.com/zmanim?cfg=json&city=${city}&date=${today}`
)
).json();
console.log(data.times.sofZemanShma);
return data.times.sofZemanShma;
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import { fetch } from "https://esm.town/v/std/fetch";
export async function keriatShemaReminser() {
const today = new Date().toISOString().split("T")[0];
const city = "IL-Jerusalem";
const { times } = await (
await fetch(
`https://www.hebcal.com/zmanim?cfg=json&city=${city}&date=${today}`
)
).json();
const sofZmanKeriatShema = times.sofZmanShma;
const timeInDay = new Date(sofZmanKeriatShema).toLocaleTimeString("en", {
timeStyle: "short",
hour12: false,
});
console.email(timeInDay);
}
Next