You are here

function cmfcCalendarV1Thai::timestampToInfoArray in Calendar Systems 8

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

Overrides cmfcCalendarV1::timestampToInfoArray

File

calendar/v1/calendarSystems/thai.class.inc.php, line 75

Class

cmfcCalendarV1Thai

Code

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