mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
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:
parent
0712a516e0
commit
027cf020b7
@ -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"
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user