mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
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
This commit is contained in:
parent
d135ae6837
commit
aa4fc0a3db
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
}
|
Loading…
Reference in New Issue
Block a user