AS javascript date function return gregorian Date. Can I retrun Hijri Calendar date from javascript date function and how? Thanks in advance

Recommended Answers

All 6 Replies

Nobody will help you like that...

Nobody will help you like that...

Any one knows script in javascript which make Hijri Calendar.

Any one knows script in javascript which make Hijri Calendar

you can use calendar control and add one statement to your page load event

I understand cultural significance of Hijri but its use on the web will be misleading to many. However you clearly have a particular audience in mind so please read on.

If you find a solution, then ensure the calendar is annotated to indicate that is is Hijri - unless that is absolutely clear from its context. Even consider including a Hijri/Gregorian switch so users can choose which to use (tricky to implement but I'm sure someone has done it).

I've not though about this before but I guess the Unix Epoch itself (1 Jan 1970 Gregorian, or 10 : Shawwal 22 1389 Hijri) is actually calendar-neutral (or maybe competes with both calendars), because it is based on yet another "temporal zero" ("temporal false zero" at the risk of being universally provocative).

To continue that train of thought, you will almost undoubtedly find it easiest to transmit and store all dates as their Unix Epoch representation, regardless of how they are represented in the user interface. Reason being, both client-side and server-side time/date methods/objects (notably in javascript and php) are inherently Unix Epoch based.

Google "Hijri Gregorian conversion" for some clues on how to approach the conversions - there are plenty of results. If you are lucky you may find utilities that extend javascript/php languages to provide Hijri methods to augment the inbuilt Gregorian methods. Javascript is eminently extendible in this way, it's just a question of whether anyone has done it and makes the code available.


Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.