Created
February 27, 2016 14:40
-
-
Save cakephp-tutorial/f851351d5cc9814ca2e9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class CustomtimeHelper extends AppHelper { | |
$days = array( | |
1 => 'Lunedì' | |
2 => 'Martedì' | |
3 => 'Mercoledì' | |
4 => 'Giovedì' | |
5 => 'Venerdì' | |
6 => 'Sabato' | |
7 => 'Domenica' | |
); | |
public function whatDay($data) { | |
$dayNumber = date('N', strtotime($data)); | |
return $this->days[$dayNumber]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment