It is currently March 28th, 2024, 5:20 pm

Hijri calendar with prayer times

Clocks and timer skins
User avatar
Mordasius
Posts: 1167
Joined: January 22nd, 2011, 4:23 pm
Location: GMT +8

Hijri calendar with prayer times

Post by Mordasius »

This skin evolved from the oldish (October 2011) Prayer Time thread that seems to have joined the great tangle of unattached threads in the Etha and a more recent thread on a Hijri Calendar. In both cases, the conversion of Javascript to Lua seemed to be the easiest way forward.

I used Javascript from here for the Prayer Times and Javascript from here for the Hijri calendar.
PrayerTimes.jpg
The trickiest thing was finding a way to display 'non-Latin' scripts like رمضان (Ramadhan) that could be edited by users in a settings.inc file and then displayed using a Lua script. I doubt the solution is very efficient and would appreciate any suggestions for improvement.

I've added the latest .rmskin file here to accommodate those unfortunate enough to be living in countries being blocked by Deviant Art.
Last edited by Mordasius on March 28th, 2024, 7:55 am, edited 3 times in total.
candrakar
Posts: 7
Joined: December 4th, 2013, 5:30 am

Re: Hijri calendar with prayer times

Post by candrakar »

Great skin but got a problem....
How can I adjust the date when it's different one or two days?
User avatar
Mordasius
Posts: 1167
Joined: January 22nd, 2011, 4:23 pm
Location: GMT +8

Re: Hijri calendar with prayer times

Post by Mordasius »

Ok. I see what you mean. The Hijri date seems to be lagging by one day. I'll have to go through the script to find out what has changed.
candrakar
Posts: 7
Joined: December 4th, 2013, 5:30 am

Re: Hijri calendar with prayer times

Post by candrakar »

Today is "safr" first but it is displayed "Muharam" 30 th
User avatar
Mordasius
Posts: 1167
Joined: January 22nd, 2011, 4:23 pm
Location: GMT +8

Re: Hijri calendar with prayer times

Post by Mordasius »

Yes I see what you mean. I used the script from http://www.oriold.uzh.ch/static/hegira.html
which shows today as 30 Muharam 1435

I'll check with the script used on http://www.al-habib.info/islamic-calendar/hijricalendartext.htm which shows today as 1 Shafar 1435

I think it has something to do with the start of the year 1435 which began on 4th November 2013 based on Ummul Qura dates or 5th November 2013 based on Suggested Global Islamic Calendar (global crescent sighting possibility).
WhatsTheDate.jpg
..and of course things are complicated still further by the fact that Islamic dates begin at sunset on the preceding evening.
candrakar
Posts: 7
Joined: December 4th, 2013, 5:30 am

Re: Hijri calendar with prayer times

Post by candrakar »

I don't know if it is doable but if there an option to manually change date after the calculation , I think it would work
User avatar
Mordasius
Posts: 1167
Joined: January 22nd, 2011, 4:23 pm
Location: GMT +8

Re: Hijri calendar with prayer times

Post by Mordasius »

candrakar wrote:I don't know if it is doable but if there an option to manually change date after the calculation
That would sorta work but lead to problems later in 2014. The underlying problem is that the The Hijri calendar has a 30-year cycle with 11 leap years of 355 days and 19 years of 354 days. The script I used was for a Tabular Islamic calendar which has years 2, 5, 7, 10, 13, 16, 18, 21, 24, 26 and 29 as leap years. This offsets the date by one day from 5 November 2013 onwards so changing the line local l=l-10631*n+354 to local l=l-10631*n+355 should keep things in order until 1437.

I'll see what I can do to come up with a more robust solution, but in the meantime, please would you download the Hijri Calendar again and let me know if it shows the date you want.
candrakar
Posts: 7
Joined: December 4th, 2013, 5:30 am

Re: Hijri calendar with prayer times

Post by candrakar »

I did re download but it shows "Al-Arbiaa" safr 1 st and Thursday December 4th instead of Thursday 5th - "safr" second ...
I think if the previous calculations were right , what about making the final display be the sum of the calculations + the manual change of one or two days past or coming
may be in this way the calculations remain the same and the user can change at the beginning of every month one or two days
I don't know if is doable but anyway Thanks a lot for your effort .
User avatar
Mordasius
Posts: 1167
Joined: January 22nd, 2011, 4:23 pm
Location: GMT +8

Re: Hijri calendar with prayer times

Post by Mordasius »

Download it again please. I inadvertently posted the version I was testing which had the date fixed on Thursday December 4th.

PantherX has confirmed what I suspected in that there is no precise correlation between the Hijri and Gregorian Calendars. The date on which the Hijri calendar changes from one month to the next depends on where you are in the world since that dictates the time / date on which the crescent moon becomes visible after sunset. c.f. http://moonsighting.com/1435zhj.html. The difference is generally only +/- 1 day but can be up to 2 days.

I've therefore updated the Deviant Art post to allow manual adjustments to the Hijri Calendar date in the settings.inc file. The latest version also changes the Hijri date at sunset.
candrakar
Posts: 7
Joined: December 4th, 2013, 5:30 am

Re: Hijri calendar with prayer times

Post by candrakar »

it doesn't show the correct date... it shows Saturday in the hijri date
and I would like to know how to change that the day starts with the previous sunset
Thanks a lot .
Post Reply