Logo Lanfrica

tamiopia/qen.js

Domaine:

natural language processing

Type de record:

software
Créateur:
tam
Hôte:
A utility package for Ethiopian date conversion, payment scheduling, and holiday checks. # qen.js 🇪🇹 A utility package for Ethiopian date conversion, payment scheduling, and holiday checks. ## Features - Convert between Ethiopian and Gregorian dates. - Generate payment schedules (e.g., monthly, quarterly). - Check Ethiopian public holidays. - Format dates in Amharic. - Calculate late fees for overdue payments. --- ## Installation Install `qen.js` using npm: ```bash npm install qen.js ``` --- ## Usage ### 1. Convert Gregorian to Ethiopian Date Convert a Gregorian date to an Ethiopian date. ```javascript const { EthiopianDate } = require('qen.js'); // Convert a Gregorian date to Ethiopian date const gregorianDate = new Date(2023, 9, 30); // October 30, 2023 const ethiopianDate = EthiopianDate.fromGregorian(gregorianDate); console.log(ethiopianDate.format('YYYY-MM-DD')); // Output: 2015-02-20 console.log(ethiopianDate.formatAmharic()); // Output: 20 የካቲት 2015 ``` **Response:** ```bash 2015-02-20 20 የካቲት 2015 ``` --- ### 2. Generate a Payment Schedule Generate a payment schedule for a given start date. ```javascript const startDate = new EthiopianDate(2015, 2, 20); // 20 Yekatit 2015 const schedule = startDate.generatePaymentSchedule(1, 12); // Monthly payments for 1 year console.log('Payment Schedule:'); schedule.forEach((date, index) => { console.log(`Payment ${index + 1}: ${date.formatAmharic()}`); }); ``` **Response:** ```bash Payment Schedule: Payment 1: 20 የካቲት 2015 Payment 2: 20 መጋቢት 2015 Payment 3: 20 ሚያዝያ 2015 Payment 4: 20 ግንቦት 2015 Payment 5: 20 ሰኔ 2015 Payment 6: 20 ሀምሌ 2015 Payment 7: 20 ኖሀሰ 2015 Payment 8: 20 ፓጩመ 2015 Payment 9: 20 መሳክረም 2016 Payment 10: 20 ጥዅምት 2016 Payment 11: 20 ህዳር 2016 Payment 12: 20 ታውሳስ 2016 ``` --- ### 3. Check if a Date is a Holiday Check if a specific date is an Ethiopian public holiday. ```javascript const isHoliday = EthiopianDate.isHoliday(2015, 1, 1); // Ethiopian New Year console.log(isHoliday); // Output: Ethiopian New Year ``` **Response:** ```bash Ethiopian New Year ``` --- ### 4. Cal …

Languages