مكتبة جافاسكريبت عربية لمعالجة التواريخ والأوقات، مع دعم كامل للتقويم الهجري والميلادي.
- معالجة التواريخ والأوقات بالعربية
- تحويل بين التقويم الهجري والميلادي
- حساب الفترات الزمنية وتنسيقها
- دعم مواقيت الصلاة
- التقويم الأكاديمي والمواسم
- إدارة المؤقتات والتنبيهات
- حساب أيام العمل والعطل الرسمية
- دعم المناطق الزمنية المختلفة
npm install treshjs
const Tresh = require('treshjs');
const date = new Tresh(new Date());
// عرض التاريخ بالعربي
console.log(date.toArabicDate());
// الخميس ١٥ رمضان ١٤٤٥، ٠٩:٣٠
// التحويل للتاريخ الهجري
console.log(date.toHijri());
// ١٥/٩/١٤٤٥
### العد التنازلي
javascript
const timer = new Tresh(Date.now() + 3600000);
timer.countdown((remaining) => {
console.log(remaining); // 00:59:59
}, {
interval: 1000,
onComplete: () => console.log('انتهى الوقت')
});
### مواقيت الصلاة
const prayerTimes = new Tresh(new Date());
console.log(prayerTimes.getPrayerTimes());
const date = new Tresh(new Date());
const holidays = date.isHoliday();
// يعرض العطل الرسمية والدينية
console.log(holidays);
const date = new Tresh(new Date());
console.log(date.toTimeZone('Africa/Cairo'));
const start = new Tresh(new Date());
const end = new Tresh(new Date().setDate(new Date().getDate() + 30));
const workingDays = start.getWorkingDays(end);
للمزيد من المعلومات والأمثلة، يرجى زيارة صفحة التوثيق.
نرحب بمساهماتكم لتحسين المكتبة. يمكنكم:
- عمل Fork للمشروع
- إنشاء فرع للتعديلات
git checkout -b feature/new-feature
- تنفيذ التعديلات وعمل Commit
git commit -m 'إضافة ميزة جديدة'
- رفع التعديلات
git push origin feature/new-feature
- فتح Pull Request
- Tresh