You are here

function cmfcCalendarV1Julian::timestampToInfoArray in Calendar Systems 8

Same name and namespace in other branches
  1. 8.2 calendar/v1/calendarSystems/julian.class.inc.php \cmfcCalendarV1Julian::timestampToInfoArray()
  2. 7 calendar/v1/calendarSystems/julian.class.inc.php \cmfcCalendarV1Julian::timestampToInfoArray()
  3. 7.2 calendar/v1/calendarSystems/julian.class.inc.php \cmfcCalendarV1Julian::timestampToInfoArray()

Overrides cmfcCalendarV1::timestampToInfoArray

File

calendar/v1/calendarSystems/julian.class.inc.php, line 94

Class

cmfcCalendarV1Julian

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'] >= 6) {
    $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;
}