hijri icon indicating copy to clipboard operation
hijri copied to clipboard

Bug: wrong conversion gre2hijri OR hijri2gre

Open seyyah opened this issue 7 years ago • 4 comments

While Greogian date is Fri, 01 Sep 2017, Hijri date must be @day=10, @month=12, @year=1438 (ie. Dhul-Hijjah 10, 1438 Al-Jum'ah (Friday) [1]) but Hijri date calculated wrongly @day=8, @month=12, @year=1438.

> date = Date.civil(2017, 9, 1)
=> Fri, 01 Sep 2017
> date.to_hijri
=> #<Hijri::Date:0x0055e6876525e8 @day=8, @month=12, @year=1438>

I found a possible solution at [1] and filter associated codes as Javascript [4].

References:

  1. http://www.islamicity.org/hijri-gregorian-converter/
  2. http://www.islamweb.net/emainpage/index.php?page=dateconverter
  3. http://www2.diyanet.gov.tr/DinHizmetleriGenelMudurlugu/Sayfalar/2017DiniG%C3%BCnlerListesi.aspx
  4. https://gist.github.com/seyyah/ebe7c309d9a9a2baf4739b6c1faf4e21

seyyah avatar Jun 24 '17 09:06 seyyah

Hello @seyyah

Sorry I've been out this month and thank you for the issue.

This is true, there is an error ratio for converting between Hijri and Georgian. I'll check your links and try to minimize the converting error.

ecleel avatar Jul 27 '17 11:07 ecleel

Hey Aziz, I'm trying to learn Ruby. If you don't mind, I'll play with this issue and see if I can fix it.

qirh avatar May 31 '19 17:05 qirh

Hey Saleh,

Please do :) and contact me if you need any help with that.

ecleel avatar Jun 01 '19 01:06 ecleel

Hey just as an update, I banged my head against this multiple times and couldn't really make any progress. I'm giving up :(

qirh avatar Oct 24 '19 16:10 qirh