1.0.5 • Published 1 year ago
gerimismalamsenin v1.0.5
Convert Gregorian Date To Chinese Lunar dan Moslem's Hijri
- The code uses the
commanderlibrary for parsing command-line arguments. - It defines a program with a version number and expects a Gregorian date as an argument.
- The action function parses the provided date string and validates its format (YYYY-MM-DD).
- It uses
chinese-lunar-calendarto convert the Gregorian date to Chinese Lunar date. - It uses
hijri-converterto convert the Gregorian date to Islamic Hijri date. - The code outputs the original Gregorian date, the converted Chinese Lunar date with year, month text, and day text, and the converted Islamic Hijri date with day, month, year, and "AH" (After Hijra).
- The
isValidGregorianDatefunction performs basic date validation (month range, day range within month). - The
getDaysInMonthfunction returns the number of days in a month (ignoring leap years for simplicity).
How To Use?
- Run the script with a Gregorian date argument: node dateConverter.js 2024-05-17
- The script will output the converted Chinese Lunar and Islamic Hijri date