gregorian-to-hijra
v1.0.0
Published
A package that take gregorian calendar dates and turns it into Hijra
Maintainers
Readme
��#� �G�r�e�g�o�r�i�a�n� �t�o� �H�i�j�r�i� �D�a�t�e� �C�o�n�v�e�r�s�i�o�n�
�
�
�
�T�h�i�s� �r�e�p�o�s�i�t�o�r�y� �p�r�o�v�i�d�e�s� �a� �J�a�v�a�S�c�r�i�p�t� �f�u�n�c�t�i�o�n� �t�o� �a�c�c�u�r�a�t�e�l�y� �c�o�n�v�e�r�t� �G�r�e�g�o�r�i�a�n� �c�a�l�e�n�d�a�r� �d�a�t�e�s� �t�o� �H�i�j�r�i� �(�I�s�l�a�m�i�c�)� �c�a�l�e�n�d�a�r� �d�a�t�e�s�.� �T�h�e� �f�u�n�c�t�i�o�n� �a�c�c�o�u�n�t�s� �f�o�r� �l�e�a�p� �y�e�a�r�s�,� �v�a�l�i�d�a�t�e�s� �i�n�p�u�t� �d�a�t�e�s�,� �a�n�d� �r�e�t�u�r�n�s� �t�h�e� �H�i�j�r�i� �y�e�a�r�,� �m�o�n�t�h�,� �a�n�d� �d�a�y� �i�n� �a� �u�s�e�r�-�f�r�i�e�n�d�l�y� �f�o�r�m�a�t�.�
�
�
�
�-�-�-�
�
�
�
�#�#� �F�e�a�t�u�r�e�s�
�
�
�
�-� ���A�c�c�u�r�a�t�e� �C�o�n�v�e�r�s�i�o�n���:� �U�t�i�l�i�z�e�s� �m�a�t�h�e�m�a�t�i�c�a�l� �c�a�l�c�u�l�a�t�i�o�n�s� �t�o� �c�o�n�v�e�r�t� �G�r�e�g�o�r�i�a�n� �d�a�t�e�s� �t�o� �t�h�e� �H�i�j�r�i� �c�a�l�e�n�d�a�r�.�
�
�-� ���I�n�p�u�t� �V�a�l�i�d�a�t�i�o�n���:� �E�n�s�u�r�e�s� �t�h�e� �G�r�e�g�o�r�i�a�n� �d�a�t�e� �i�s� �v�a�l�i�d� �b�e�f�o�r�e� �p�e�r�f�o�r�m�i�n�g� �t�h�e� �c�o�n�v�e�r�s�i�o�n�.�
�
�-� ���D�y�n�a�m�i�c� �M�o�n�t�h� �H�a�n�d�l�i�n�g���:� �A�c�c�o�u�n�t�s� �f�o�r� �v�a�r�y�i�n�g� �m�o�n�t�h� �l�e�n�g�t�h�s� �i�n� �b�o�t�h� �G�r�e�g�o�r�i�a�n� �a�n�d� �H�i�j�r�i� �c�a�l�e�n�d�a�r�s�.�
�
�-� ���H�u�m�a�n�-�R�e�a�d�a�b�l�e� �F�o�r�m�a�t���:� �P�r�o�v�i�d�e�s� �t�h�e� �H�i�j�r�i� �d�a�t�e� �i�n� �a� �w�e�l�l�-�f�o�r�m�a�t�t�e�d� �s�t�r�i�n�g�.�
�
�-� ���E�r�r�o�r� �H�a�n�d�l�i�n�g���:� �C�l�e�a�r� �e�r�r�o�r� �m�e�s�s�a�g�e�s� �f�o�r� �i�n�v�a�l�i�d� �i�n�p�u�t�s�.�
�
�
�
�-�-�-�
�
�
�
�#�#� �I�n�s�t�a�l�l�a�t�i�o�n�
�
�
�
�T�o� �u�s�e� �t�h�i�s� �p�a�c�k�a�g�e� �i�n� �y�o�u�r� �p�r�o�j�e�c�t�,� �f�i�r�s�t� �i�n�s�t�a�l�l� �i�t� �u�s�i�n�g� �n�p�m�:�
�
�
�
����b�a�s�h�
�
�n�p�m� �i�n�s�t�a�l�l� �g�r�e�g�o�r�i�a�n�-�t�o�-�h�i�j�r�i�
�
����
�
�
�
�-�-�-�
�
�
�
�#�#� �U�s�a�g�e�
�
�
�
�#�#�#� �I�m�p�o�r�t� �t�h�e� �F�u�n�c�t�i�o�n�
�
�
�
�Y�o�u� �c�a�n� �i�m�p�o�r�t� �t�h�e� �f�u�n�c�t�i�o�n� �i�n� �y�o�u�r� �J�a�v�a�S�c�r�i�p�t� �o�r� �T�y�p�e�S�c�r�i�p�t� �p�r�o�j�e�c�t� �a�s� �f�o�l�l�o�w�s�:�
�
�
�
����j�a�v�a�s�c�r�i�p�t�
�
�/�/� �F�o�r� �E�S�6� �i�m�p�o�r�t�s�
�
�i�m�p�o�r�t� �{� �g�r�e�g�o�r�i�a�n�T�o�H�i�j�r�a� �}� �f�r�o�m� �'�g�r�e�g�o�r�i�a�n�-�t�o�-�h�i�j�r�i�'�;�
�
�
�
�/�/� �F�o�r� �C�o�m�m�o�n�J�S�
�
�c�o�n�s�t� �{� �g�r�e�g�o�r�i�a�n�T�o�H�i�j�r�a� �}� �=� �r�e�q�u�i�r�e�(�'�g�r�e�g�o�r�i�a�n�-�t�o�-�h�i�j�r�i�'�)�;�
�
����
�
�
�
�#�#�#� �E�x�a�m�p�l�e� �U�s�a�g�e�
�
�
�
����j�a�v�a�s�c�r�i�p�t�
�
�/�/� �E�x�a�m�p�l�e�:� �C�o�n�v�e�r�t�i�n�g� �G�r�e�g�o�r�i�a�n� �d�a�t�e� �t�o� �H�i�j�r�i� �d�a�t�e�
�
�c�o�n�s�t� �r�e�s�u�l�t� �=� �g�r�e�g�o�r�i�a�n�T�o�H�i�j�r�a�(�2�0�2�5�,� �1�,� �2�6�)�;�
�
�
�
�c�o�n�s�o�l�e�.�l�o�g�(�r�e�s�u�l�t�)�;�
�
�/�/� �O�u�t�p�u�t�:�
�
�/�/� �{� �
�
�/�/� � � �h�i�j�r�a�Y�e�a�r�:� �1�4�4�6�,� �
�
�/�/� � � �h�i�j�r�a�M�o�n�t�h�:� �6�,� �
�
�/�/� � � �h�i�j�r�a�D�a�y�:� �3�,� �
�
�/�/� � � �f�o�r�m�a�t�t�e�d�:� �"�3� �J�u�m�a�d�a� �a�l�-�T�h�a�n�i�,� �1�4�4�6� �A�H�"� �
�
�/�/� �}�
�
�
�
�c�o�n�s�o�l�e�.�l�o�g�(��H�i�j�r�i� �D�a�t�e�:� �$�{�r�e�s�u�l�t�.�f�o�r�m�a�t�t�e�d�}��)�;� �
�
�/�/� �O�u�t�p�u�t�:� �H�i�j�r�i� �D�a�t�e�:� �3� �J�u�m�a�d�a� �a�l�-�T�h�a�n�i�,� �1�4�4�6� �A�H�
�
����
�
�
�
�-�-�-�
�
�
�
�#�#� �O�u�t�p�u�t�
�
�
�
�F�o�r� �t�h�e� �G�r�e�g�o�r�i�a�n� �d�a�t�e� ���J�a�n�u�a�r�y� �2�6�,� �2�0�2�5���,� �t�h�e� �f�u�n�c�t�i�o�n� �r�e�t�u�r�n�s�:� � �
�
�-� ���H�i�j�r�i� �Y�e�a�r���:� �1�4�4�6� � �
�
�-� ���H�i�j�r�i� �M�o�n�t�h���:� �6� �(�J�u�m�a�d�a� �a�l�-�T�h�a�n�i�)� � �
�
�-� ���H�i�j�r�i� �D�a�y���:� �3� � �
�
�-� ���F�o�r�m�a�t�t�e�d� �D�a�t�e���:� ��"�3� �J�u�m�a�d�a� �a�l�-�T�h�a�n�i�,� �1�4�4�6� �A�H�"��
�
�
�
�-�-�-�
�
�
�
�#�#� �H�o�w� �I�t� �W�o�r�k�s�
�
�
�
�1�.� ���T�o�t�a�l� �G�r�e�g�o�r�i�a�n� �D�a�y�s� �C�a�l�c�u�l�a�t�i�o�n���:� � �
�
� � � �C�o�m�p�u�t�e�s� �t�h�e� �t�o�t�a�l� �d�a�y�s� �f�r�o�m� �y�e�a�r� �1� �t�o� �t�h�e� �g�i�v�e�n� �G�r�e�g�o�r�i�a�n� �d�a�t�e�,� �a�c�c�o�u�n�t�i�n�g� �f�o�r� �l�e�a�p� �y�e�a�r�s�.�
�
�
�
�2�.� ���H�i�j�r�i� �Y�e�a�r� �D�e�t�e�r�m�i�n�a�t�i�o�n���:� � �
�
� � � �C�o�n�v�e�r�t�s� �t�o�t�a�l� �G�r�e�g�o�r�i�a�n� �d�a�y�s� �t�o� �H�i�j�r�i� �y�e�a�r�s� �b�a�s�e�d� �o�n� �t�h�e� �l�u�n�a�r� �c�a�l�e�n�d�a�r�.�
�
�
�
�3�.� ���M�o�n�t�h� �a�n�d� �D�a�y� �D�i�s�t�r�i�b�u�t�i�o�n���:� � �
�
� � � �D�i�s�t�r�i�b�u�t�e�s� �t�h�e� �r�e�m�a�i�n�i�n�g� �d�a�y�s� �i�n�t�o� �t�h�e� �1�2� �H�i�j�r�i� �m�o�n�t�h�s� �w�i�t�h� �p�r�e�d�e�f�i�n�e�d� �m�o�n�t�h� �l�e�n�g�t�h�s�.�
�
�
�
�4�.� ���F�o�r�m�a�t�t�e�d� �O�u�t�p�u�t���:� � �
�
� � � �C�o�m�b�i�n�e�s� �t�h�e� �H�i�j�r�i� �y�e�a�r�,� �m�o�n�t�h� �n�a�m�e�,� �a�n�d� �d�a�y� �i�n�t�o� �a� �u�s�e�r�-�f�r�i�e�n�d�l�y� �s�t�r�i�n�g�.�
�
�
�
�-�-�-�
�
�
�
�#�#� �V�a�l�i�d�a�t�i�o�n�
�
�
�
�T�h�e� �f�u�n�c�t�i�o�n� �v�a�l�i�d�a�t�e�s� �t�h�e� �f�o�l�l�o�w�i�n�g�:�
�
�-� �M�o�n�t�h� �i�s� �w�i�t�h�i�n� �t�h�e� �r�a�n�g�e� �(�1� 1�2�)�.�
�
�-� �D�a�y� �i�s� �v�a�l�i�d� �f�o�r� �t�h�e� �g�i�v�e�n� �m�o�n�t�h�,� �c�o�n�s�i�d�e�r�i�n�g� �l�e�a�p� �y�e�a�r�s� �i�n� �G�r�e�g�o�r�i�a�n� �c�a�l�e�n�d�a�r�.�
�
�
�
�-�-�-�
�
�
�
�#�#� �E�r�r�o�r� �H�a�n�d�l�i�n�g�
�
�
�
�T�h�r�o�w�s� �a�n� �e�r�r�o�r� �i�f� �a�n� �i�n�v�a�l�i�d� �G�r�e�g�o�r�i�a�n� �d�a�t�e� �i�s� �p�r�o�v�i�d�e�d�:�
�
�
�
����j�a�v�a�s�c�r�i�p�t�
�
�t�r�y� �{�
�
� � �c�o�n�s�t� �r�e�s�u�l�t� �=� �g�r�e�g�o�r�i�a�n�T�o�H�i�j�r�a�(�2�0�2�5�,� �1�3�,� �3�2�)�;� �/�/� �I�n�v�a�l�i�d� �d�a�t�e�
�
�}� �c�a�t�c�h� �(�e�r�r�o�r�)� �{�
�
� � �c�o�n�s�o�l�e�.�e�r�r�o�r�(�e�r�r�o�r�.�m�e�s�s�a�g�e�)�;� �/�/� �"�I�n�v�a�l�i�d� �G�r�e�g�o�r�i�a�n� �d�a�t�e�"�
�
�}�
�
����
�
�
�
�-�-�-�
�
�
�
�#�#� �F�u�t�u�r�e� �E�n�h�a�n�c�e�m�e�n�t�s�
�
�
�
�-� �A�d�d� �s�u�p�p�o�r�t� �f�o�r� �h�i�s�t�o�r�i�c�a�l� �d�a�t�e� �a�n�o�m�a�l�i�e�s� �(�e�.�g�.�,� �p�r�e�-�G�r�e�g�o�r�i�a�n� �c�a�l�e�n�d�a�r�)�.�
�
�-� �E�x�p�a�n�d� �f�u�n�c�t�i�o�n�a�l�i�t�y� �f�o�r� �r�e�v�e�r�s�e� �c�o�n�v�e�r�s�i�o�n� �(�H�i�j�r�i� �t�o� �G�r�e�g�o�r�i�a�n�)�.�
�
�-� �L�o�c�a�l�i�z�a�t�i�o�n� �s�u�p�p�o�r�t� �f�o�r� �H�i�j�r�i� �m�o�n�t�h� �n�a�m�e�s�.�
�
�
�
�-�-�-�
�
�
�
�#�#� �L�i�c�e�n�s�e�
�
�
�
�T�h�i�s� �p�r�o�j�e�c�t� �i�s� �o�p�e�n�-�s�o�u�r�c�e� �u�n�d�e�r� �t�h�e� �[�M�I�T� �L�i�c�e�n�s�e�]�(�L�I�C�E�N�S�E�)�.�
�
�
�
�-�-�-�
�
�
�
�#�#� �C�o�n�t�r�i�b�u�t�i�n�g�
�
�
�
�C�o�n�t�r�i�b�u�t�i�o�n�s�,� �i�s�s�u�e�s�,� �a�n�d� �f�e�a�t�u�r�e� �r�e�q�u�e�s�t�s� �a�r�e� �w�e�l�c�o�m�e�!� �F�e�e�l� �f�r�e�e� �t�o� �f�o�r�k� �t�h�i�s� �r�e�p�o�s�i�t�o�r�y� �a�n�d� �s�u�b�m�i�t� �a� �p�u�l�l� �r�e�q�u�e�s�t�.�
�
�
�
�-�-�-�
�
�
�
�#�#� �A�u�t�h�o�r�
�
�
�
���I�b�r�a�h�i�m� �A�b�d�u�l�q�u�a�d�r�i� �A�b�i�o�d�u�n��� � �
�
�F�r�o�n�t�e�n�d� �D�e�v�e�l�o�p�e�r� �|� �J�a�v�a�S�c�r�i�p�t� �E�n�t�h�u�s�i�a�s�t� �|� �T�e�c�h� �A�d�v�o�c�a�t�e� � �
�
�
�
�
