Hijri (Arabic) date picker calendar using PHP or Javascript

I am working on a project that has a form that requires the user to enter a date using the Hijri calendar (Arabic). I am familiar with the Javascript datepickers for the Gregorian calendar.

I searched a lot on the Internet and closest I got the JS code for the Persian calendar, which is in Arabic, but everything else is different. For example, the names of days, months, etc. And the Persian calendar is based on the solar calendar.

In any case, please tell me what I can do.

Thanks.

+7
source share
2 answers

You must use the library / class to complete this conversion task, one of the options available is what the Ar-PHP library provides (this is a free open source library published under the LGPL license). The following is sample code:

date_default_timezone_set('UTC'); $time = time(); require('I18N/Arabic.php'); $obj = new I18N_Arabic('Date'); $fix = $obj->dateCorrection ($time); echo $obj->date('l dS FY h:i:s A', $time, $fix); 

You can find an example of life and check out here

More information on how to make the calculation can be found here.

+4
source

An Arabic PHP project can help you with PHP.

http://www.ar-php.org/features-php-arabic.html

+1
source

All Articles