You are here

function cmfcCalendarV1Gregorian::timestampToInfoArray in Calendar Systems 7.2

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

Overrides cmfcCalendarV1::timestampToInfoArray

File

calendar/v1/calendarSystems/gregorian.class.inc.php, line 87

Class

cmfcCalendarV1Gregorian
@desc

Code

function timestampToInfoArray($timestamp = null) {
  if (is_null($timestamp)) {
    $timestamp = $this
      ->phpTime();
  }
  $arr = $this
    ->phpGetDate($timestamp);
  $arr['month'] = $arr['mon'];
  $arr['day'] = $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;
  $arr['monthDaysNumber'] = $this
    ->phpDate('t', $timestamp);
  $arr['weekday']++;
  $arr['weekday'] = $arr['wday'];
  $arr['weekdayName'] = $this
    ->getWeekName($arr['weekday']);
  $arr['weekdayShortName'] = $this
    ->getWeekShortName($arr['weekday']);
  return $arr;
}