For Gregorian-> Hijiri see here
A bi-directional version of C # here that can be converted to Javascript
EDIT: A great page and converters can be found here . This page says:
All calculations are performed in JavaScript in a native browser; the complete source code is embedded or linked to this page, and you can download their files to your computer and use even if they are not connected to the Internet.
which tells me that you can use the code, but you probably want to check it with the author of the page
The archetypal paul
source share