ENHANCEMENT #3232 lenix: Added Date::FormatI18N()

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@72119 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2009-02-23 19:50:16 +00:00
parent 0712a516e0
commit 027cf020b7

View File

@ -70,6 +70,16 @@ class Date extends DBField {
if($this->value) return date($formattingString, strtotime($this->value));
}
/**
* Return the date formatted using the given strftime formatting string.
*
* strftime obeyes the current LC_TIME/LC_ALL when printing lexical values
* like day- and month-names
*/
function FormatI18N($formattingString) {
if($this->value) return strftime($formattingString, strtotime($this->value));
}
/*
* Return a string in the form "12 - 16 Sept" or "12 Aug - 16 Sept"
*/