Skip to content

Instantly share code, notes, and snippets.

@cakephp-tutorial
Created February 27, 2016 14:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cakephp-tutorial/7eea93181a014c07ecbc to your computer and use it in GitHub Desktop.
Save cakephp-tutorial/7eea93181a014c07ecbc to your computer and use it in GitHub Desktop.
<?php
private function setProperties($time, $settings)
{
//set a day information
$type = (isset($settings['type'])) ? $settings['type'] : 'long';
$this->settings['day'] = $this->Time->format('N', $time);
$this->settings['dayLetters'] = $this->days[$this->settings['day']][$type];
$this->settings['dayNumbers'] = $this->Time->format('d', $time);
//set a month information
$this->settings['month'] = $this->Time->format('n', $time);
$this->settings['monthLetters'] = $this->months[$this->settings['month']][$type];
$this->settings['monthNumbers'] = $this->Time->format('m', $time);
//set a year, hours and minutes information
$this->settings['hours'] = $this->Time->format('H', $time);
$this->settings['minutes'] = $this->Time->format('i', $time);
$this->settings['hoursMinutes'] = (isset($settings['showHour']) && !$settings['showHour']) ? '' : ' alle '. $this->Time->format('H:i', $time);
$this->settings['hoursMinutesPast'] = (isset($settings['showHourPast']) && !$settings['showHourPast']) ? '' : ' alle '. $this->Time->format('H:i', $time);
$this->settings['year'] = $this->Time->format('Y', $time);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment