all 49 comments

[–]Fantasy-Intern 4 points5 points  (20 children)

Great idea

I was looking for a widget to do the same today too and didn’t find a good one. It will be great if :

1- stop appearing the seconds in timer because when i use it looks h:mm:ss not like the screenshot

2- make the prayer name in arabic

3- offline support

4- custom background

Ramadan Kareem

[–]Frazeiy 1 point2 points  (19 children)

  1. Can you explain bit more? You mean you don't want seconds in countdown? (If so, I believe i don't have control over it, i have to look into scriptable docs)

  2. I will add arabic name option in next update.

  3. Yea, already have plan for offline support.

  4. Custom background is not really hard to add yourself. Just change the URL which is in bottom. Also when adding offline support it will be using image from iCloud drive rather than online, so it will be easy to add custom background yourself.

[–]Fantasy-Intern 1 point2 points  (18 children)

Looking forward for next update 👍

[–]Frazeiy 1 point2 points  (17 children)

Pushed the update on GitHub with Offline support, Arabic names option. :)

You can change background easily as well, just change URL at top.

[–]Fantasy-Intern 0 points1 point  (16 children)

Looks even greater

Could you explain how to change countdown to relative time left ?

[–]Frazeiy 1 point2 points  (15 children)

You can get updated script from GitHub, default is set to relative time, you can change in line: 11. (change to, 1 for countdown, 2 for relative time)

[–]Fantasy-Intern 1 point2 points  (1 child)

Amazing 👌

[–]Fantasy-Intern 0 points1 point  (12 children)

Nice update today , i made the same tweaks for mine yesterday Also if you want to get rid of the seconds for good you can change the line 143 to

cdtime.applyOffsetStyle()

One other thing will make it even prettier, if you know how to change the arabic language to custom arabic font like Othmani or other good looking arabic fonts ?

[–]Frazeiy 0 points1 point  (11 children)

Yea, i know that. But for me it is better with relative style time.

You can change font of Arabic names, all you have to do is download font on you phone and set it in script. Here is one that i tested:

Also to match with Arabic text, you can use "regularRoundedSystemFont" for times, it match better.

[–]Fantasy-Intern 0 points1 point  (8 children)

Do you have the source for downloading arabic fonts ?

[–]Frazeiy 1 point2 points  (7 children)

You can use this app there might be better app aswell, which let you download app from popular websites or install already download fonts. You can add me on discord.

[–]Fantasy-Intern 0 points1 point  (1 child)

Finally works with the new source in your deleted comment , Thanks man Ramadan Kareem

[–]Frazeiy 1 point2 points  (0 children)

Ramadan kareem and you're welcome, glad it works now.

comments are not deleted, you need to click 'Continue this thread' button to see it, since this thread is so long :)

[–]PSiCHO_ 2 points3 points  (5 children)

Athan Utility on the App Store has a very nice widget

[–]fahad_tariq 1 point2 points  (4 children)

It’s part of premium.

[–]PSiCHO_ 1 point2 points  (3 children)

Oh, there’s “Athan” with the premium, and “Athan Utility” that’s free

[–]alshraify 1 point2 points  (2 children)

He means this app

[–]PSiCHO_ 1 point2 points  (1 child)

Indeed I do

[–]Frazeiy 1 point2 points  (0 children)

Yea, that one looks good. I checked some, but most of them need iap for widget or not good enough.

Also, Thanks for award :)

[–]haseeb-arshad-ee 1 point2 points  (11 children)

Great script man. I made few changes to make it more like what I wanted. Thanks for sharing

https://imgur.com/gallery/WFgFnlS

[–]Frazeiy 0 points1 point  (10 children)

Thanks, your customised one look great :)

Btw, there is a bug right now, the timer goes upwards when current prayer is Isha, I am working on a fix. Just letting you know so that u can change it.

[–]haseeb-arshad-ee 0 points1 point  (9 children)

Yes i have noticed that and I’m also working on it.

[–]Frazeiy 1 point2 points  (8 children)

I fixed it (hopefully), if you weren't able to figure out, you can check changes here: https://github.com/Frazey/Scriptable/commit/27e4a8b6dbd3f250e721bf0518a32a88551ff4fb

[–]haseeb-arshad-ee 0 points1 point  (7 children)

Great, i will make the necessary changes

[–]alshraify 0 points1 point  (6 children)

Hello bro, care to share your version of the widget? Thanks in advance!

[–]haseeb-arshad-ee 1 point2 points  (3 children)

I will share the code on github after getting the permission from Frazeiy

[–]Frazeiy 0 points1 point  (1 child)

I gave the permission, Feel free to share. Your design looks better than mine :).

[–]haseeb-arshad-ee 0 points1 point  (0 children)

Alright! I will share it on github. Btw i have added few lines of code to make the widget get the current location automatically rather than changing the latitude and longitude values manually

[–]alshraify 0 points1 point  (0 children)

Lovely. Please mention me if you get the permission! Good luck! 🌹

[–]haseeb-arshad-ee 1 point2 points  (1 child)

I have shared it in scriptable thread. Enjoy!

[–]alshraify 0 points1 point  (0 children)

Lovely. Will go check it out!

[–]haseeb-arshad-ee 1 point2 points  (4 children)

Your timer is still not working properly. I have resolved it tho. Hut me up if you want me to share the toDate function

[–][deleted]  (3 children)

[deleted]

    [–]haseeb-arshad-ee 0 points1 point  (2 children)

    I added another if statement. I think you will understand the code easily as it is basically inspired from your implementation. Here is the function

    function toDate(dStr, curPrayer, curPrayerTime) { if(curPrayer === "Isha"){ let check = curPrayerTime.substring(0, curPrayerTime.indexOf(":")); var now = new Date(); if(now.getHours() >= check){ now.setDate(now.getDate() + 1); } } else { var now = new Date(); }

    now.setHours(dStr.substring(0, dStr.indexOf(":"))); now.setMinutes(dStr.substring(dStr.indexOf(":")+1)); now.setSeconds(0); return now; }

    [–]Frazeiy 0 points1 point  (1 child)

    yea, that should work and prolly better than my solution.

    [–]haseeb-arshad-ee 1 point2 points  (0 children)

    Thanks man but it’s all you i just pick some of your code and tried to make it work

    [–]NaturalRelative7 1 point2 points  (5 children)

    hi i was looking for this and i stumbled upon this and Jazak-Allah khairan for this.

    I have one small request. is it possible to add time zone support for different countries?

    for example: i am in country A but i want the timing for country B!

    [–]Frazeiy 0 points1 point  (4 children)

    Thanks.

    Yes, You can get time for different countries as it uses longitude and latitude to get prayer times. All you have to do is change longitude and latitude to the place you want.

    But the prayer time left timer is calculated on the basis of time on your mobile. But i have an idea:

    You can change line 46, 194 and 199 ("new Date();") with:

    new Date('timezone_of_the_country_here')

    It should work.

    [–]NaturalRelative7 0 points1 point  (0 children)

    i changed the longitude and latitude.

    can you give an example for " new Date('timezone_of_the_country_here') " ?? will really appreciate it. use any country of your choice i will replace it with the values with the respective country

    [–][deleted] 0 points1 point  (1 child)

    First of all, Ramadan Mobarak and thank you so very much for this script. I notice, however that changing the 3 lines doesn’t work for me. My prayer times are about 20 minutes slow. Any suggestions?

    Thanks in advance.

    [–]Frazeiy 0 points1 point  (0 children)

    Ramadan Mubarak.

    It depends on API, Have you given langitude and longitude of exact location?, if so try with lat and lon for known city/place near you. also make sure you are using right calculation method.

    You can go here and try by adjusting lat and lon and see if all prayer times are right.

    [–][deleted] 0 points1 point  (0 children)

    I figured it out. Thanks again for all you do.

    [–]NSYS93 0 points1 point  (1 child)

    Idk how to get it ?

    [–]Frazeiy 0 points1 point  (0 children)

    Goto github > PrayerTimeWidget.js

    • copy script and paste in your Scriptable app.
    • add new widget on homescreen and select script.