diff options
author | Jakob Sack <kde@jakobsack.de> | 2011-08-08 23:14:47 +0200 |
---|---|---|
committer | Jakob Sack <kde@jakobsack.de> | 2011-08-08 23:14:47 +0200 |
commit | 4b967a941426dbc7994105208e2226524651bf6d (patch) | |
tree | b78411e04a9f1ab8588621ad8c11c90612da97d2 /lib/l10n.php | |
parent | ded97de8915975d169025fd8d3a8ebab8cbfa513 (diff) | |
download | nextcloud-server-4b967a941426dbc7994105208e2226524651bf6d.tar.gz nextcloud-server-4b967a941426dbc7994105208e2226524651bf6d.zip |
Minor improvements
Diffstat (limited to 'lib/l10n.php')
-rw-r--r-- | lib/l10n.php | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/lib/l10n.php b/lib/l10n.php index 4e65af66c4f..5271bd4e589 100644 --- a/lib/l10n.php +++ b/lib/l10n.php @@ -146,16 +146,11 @@ class OC_L10N{ // If you add something don't forget to add it to $localizations // at the top of the page case 'date': - if( is_string( $data )) $data = strtotime( $data ); - return date( $this->localizations['date'], $data ); - break; case 'datetime': - if( is_string( $data )) $data = strtotime( $data ); - return date( $this->localizations['datetime'], $data ); - break; case 'time': - if( is_string( $data )) $data = strtotime( $data ); - return date( $this->localizations['time'], $data ); + if( $data instanceof DateTime ) return $data->format($this->localizations[$type]); + elseif( is_string( $data )) $data = strtotime( $data ); + return date( $this->localizations[$type], $data ); break; default: return false; |