daysUntilEndOfYear static method
حساب الأيام المتبقية لنهاية السنة الهجرية الحالية
Implementation
static int daysUntilEndOfYear() {
final now = DateTime.now();
final currentHijri = HijriDate.fromDate(now);
int totalDays = 0;
// أيام متبقية في الشهر الحالي
totalDays += daysUntilEndOfCurrentMonth();
// أيام الأشهر المتبقية في السنة
for (int month = currentHijri.hMonth + 1; month <= 12; month++) {
totalDays += currentHijri.getDaysInMonth(currentHijri.hYear, month);
}
return totalDays;
}