From b3f7afa799415184c744de82c0e0d59a3ecac68a Mon Sep 17 00:00:00 2001 From: akulikov Date: Mon, 25 May 2009 09:35:51 +0000 Subject: [PATCH] Format class improved #31 git-svn-id: svn+ssh://code.netmonsters.ru/svn/majestic/branches/legacy@91 4cb57b5f-5bbd-dd11-951b-001d605cbbc5 --- classes/Format.class.php | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/classes/Format.class.php b/classes/Format.class.php index 03ee5cd..8a96362 100644 --- a/classes/Format.class.php +++ b/classes/Format.class.php @@ -21,9 +21,9 @@ class Format /* Date & time */ static protected $time_format = 'H:i:s'; static protected $date_format = 'd.m.Y'; - static protected $today_format = 'Сегодня'; + static protected $today_format = 'd.m.Y'; //disabled by default static protected $date_time_format = 'H:i d.m.Y'; - static protected $today_time_format = 'H:i Сегодня'; + static protected $today_time_format = 'H:i d.m.Y'; //disabled by default static protected $timezone_offset = 0; /* money */ @@ -118,11 +118,23 @@ class Format * Установка форматов даты * */ - static public function setDateTimeFormat($date_time_format, $today_time_format = false) + static public function setDateFormat($date_time_format, $date_format = false) { self::$date_time_format = $date_time_format; - if ($today_time_format) { - self::$today_time_format = $today_time_format; + if ($date_format) { + self::$date_format = $date_format; + } + } + + /** + * Установка форматов даты для текущего дня + * + */ + static public function setTodayFormat($today_time_format, $today_format = false) + { + self::$today_time_format = $today_time_format; + if ($today_format) { + self::$today_format = $today_format; } }