Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Date is for manipulations with date
- *
- * @author Olga Gramovich
- */
- class Application_Model_Utils_Date {
- static $MONTHES = array('12' => "Декабрь", '01' => 'Январь', '02' => 'Февраль', '03' => 'Март',
- '04' => 'Апрель', '05' => 'Май', '06' => 'Июнь', '07' => 'Июль', '08' => 'Август',
- '09' => 'Сентябрь', '10' => 'Октябрь', '11' => 'Ноябрь');
- static $WEEK_SHORT = array('1' => 'Пн', '2' => 'Вт', '3' => 'Ср',
- '4' => 'Чт', '5' => 'Пт', '6' => 'Сб', '0' => 'Вс');
- public static function getMonth($month) {
- return Application_Model_Utils_Date::$MONTHES[$month];
- }
- public static function getPreviousMonth($year, $month) {
- return date("m", mktime(0, 0, 0, $month - 1, 1, $year));
- }
- public static function getNextMonth($year, $month) {
- return date("m", mktime(0, 0, 0, $month + 1, 1, $year));
- }
- public static function getPreviousYear($year, $month) {
- return date("Y", mktime(0, 0, 0, $month - 1, 1, $year));
- }
- public static function getNextYear($year, $month) {
- return date("Y", mktime(0, 0, 0, $month + 1, 1, $year));
- }
- }
- ?>
Add Comment
Please, Sign In to add comment