function cmfcCalendarV1Iranian::monthTotalDays in Calendar Systems 7.3
Same name and namespace in other branches
- 8 calendar/v1/calendarSystems/iranian.class.inc.php \cmfcCalendarV1Iranian::monthTotalDays()
- 8.2 calendar/v1/calendarSystems/iranian.class.inc.php \cmfcCalendarV1Iranian::monthTotalDays()
- 5 calendar/v1/calendarSystems/iranian.class.inc.php \cmfcCalendarV1Iranian::monthTotalDays()
- 6.3 calendar/v1/calendarSystems/iranian.class.inc.php \cmfcCalendarV1Iranian::monthTotalDays()
- 6 calendar/v1/calendarSystems/iranian.class.inc.php \cmfcCalendarV1Iranian::monthTotalDays()
- 7 calendar/v1/calendarSystems/iranian.class.inc.php \cmfcCalendarV1Iranian::monthTotalDays()
- 7.2 calendar/v1/calendarSystems/iranian.class.inc.php \cmfcCalendarV1Iranian::monthTotalDays()
* @author * Find Number Of Days In This Month
1 call to cmfcCalendarV1Iranian::monthTotalDays()
- cmfcCalendarV1Iranian::date in calendar/
v1/ calendarSystems/ iranian.class.inc.php - Implementation of PHP date function This is the simplified versino by Sina Salek
File
- calendar/
v1/ calendarSystems/ iranian.class.inc.php, line 651
Class
Code
function monthTotalDays($month, $day, $year) {
$jday2 = "";
$jdate2 = "";
$lastdayen = $this
->phpDate("d", mktime(0, 0, 0, $month + 1, 0, $year));
list($jyear, $jmonth, $jday) = $this
->fromGregorian($year, $month, $day);
$lastdatep = $jday;
$jday = $jday2;
while ($jday2 != "1") {
if ($day < $lastdayen) {
$day++;
list($jyear, $jmonth, $jday2) = $this
->fromGregorian($year, $month, $day);
if ($jdate2 == "1") {
break;
}
if ($jdate2 != "1") {
$lastdatep++;
}
}
else {
$day = 0;
$month++;
if ($month == 13) {
$month = "1";
$year++;
}
}
}
return $lastdatep - 1;
}