ENHANCEMENT: added Month function for consistency

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@104935 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Will Rossiter 2010-05-16 02:39:38 +00:00 committed by Sam Minnee
parent 376ee3c665
commit a9b238885c

View File

@ -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));
@ -347,6 +354,4 @@ class Date extends DBField {
public function scaffoldFormField($title = null, $params = null) {
return new DateField($this->name, $title);
}
}
?>
}