You are here

function cmfcCalendarV1Iranian::timestampToInfoArray in Calendar Systems 5

Same name and namespace in other branches
  1. 8 calendar/v1/calendarSystems/iranian.class.inc.php \cmfcCalendarV1Iranian::timestampToInfoArray()
  2. 8.2 calendar/v1/calendarSystems/iranian.class.inc.php \cmfcCalendarV1Iranian::timestampToInfoArray()
  3. 6.3 calendar/v1/calendarSystems/iranian.class.inc.php \cmfcCalendarV1Iranian::timestampToInfoArray()
  4. 6 calendar/v1/calendarSystems/iranian.class.inc.php \cmfcCalendarV1Iranian::timestampToInfoArray()
  5. 7.3 calendar/v1/calendarSystems/iranian.class.inc.php \cmfcCalendarV1Iranian::timestampToInfoArray()
  6. 7 calendar/v1/calendarSystems/iranian.class.inc.php \cmfcCalendarV1Iranian::timestampToInfoArray()
  7. 7.2 calendar/v1/calendarSystems/iranian.class.inc.php \cmfcCalendarV1Iranian::timestampToInfoArray()

Overrides cmfcCalendarV1::timestampToInfoArray

File

calendar/v1/calendarSystems/iranian.class.inc.php, line 102

Class

cmfcCalendarV1Iranian

Code

function timestampToInfoArray($timestamp = null) {
  $arr = $this
    ->phpGetDate($timestamp);
  if (is_null($timestamp)) {
    $timestamp = $this
      ->phpTime();
  }
  list($arr['year'], $arr['month'], $arr['day']) = $this
    ->fromGregorian($arr['year'], $arr['mon'], $arr['mday']);
  $arr['monthName'] = $this
    ->getMonthName($arr['month']);
  $arr['monthShortName'] = $this
    ->getMonthShortName($arr['month']);
  $arr['monthFirstDayWeekday'] = $this
    ->phpDate('w', $this
    ->infoArrayToTimestamp(array(
    'year' => $arr['year'],
    'month' => $arr['month'],
    'day' => '1',
  ))) + 1;
  if ($arr['monthFirstDayWeekday'] > 0) {
    $arr['monthFirstDayWeekday'] = 0;
  }
  $arr['monthDaysNumber'] = $this
    ->date('t', $timestamp);
  $arr['weekday']++;
  $arr['weekday'] = $arr['wday'];
  $arr['weekdayName'] = $this
    ->getWeekName($arr['weekday']);
  $arr['weekdayShortName'] = $this
    ->getWeekShortName($arr['weekday']);
  return $arr;
}