From aa4fc0a3db56ec0da246c6464a6e5eea55bc7ab7 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Fri, 15 Oct 2010 01:17:45 +0000 Subject: [PATCH] ENHANCEMENT: added Month function for consistency (from r104935) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112409 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- core/model/fieldtypes/Date.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/core/model/fieldtypes/Date.php b/core/model/fieldtypes/Date.php index e7925171f..7b7f05d8c 100644 --- a/core/model/fieldtypes/Date.php +++ b/core/model/fieldtypes/Date.php @@ -70,7 +70,14 @@ class Date extends DBField { } /** - * Returns the month + * Returns a full textual representation of a month, such as January. + */ + function Month() { + if($this->value) return date('F', strtotime($this->value)); + } + + /** + * Returns the short version of the month such as Jan */ function ShortMonth() { if($this->value) return date('M', strtotime($this->value)); @@ -350,6 +357,4 @@ class Date extends DBField { public function scaffoldFormField($title = null, $params = null) { return new DateField($this->name, $title); } - -} -?> +} \ No newline at end of file