summaryrefslogtreecommitdiffstats
path: root/core/ajax
diff options
context:
space:
mode:
authorBjoern Schiessle <schiessle@owncloud.com>2014-01-27 12:47:54 +0100
committerBjoern Schiessle <schiessle@owncloud.com>2014-01-27 12:47:54 +0100
commit2bb13a8db96f8e17d04274b77f5062dca0df5b0e (patch)
tree7ec0af3c9c2e4a51d8f9d79a9eb91adef593d1b2 /core/ajax
parent46745895ae6db0efac52461497853d037230bcae (diff)
downloadnextcloud-server-2bb13a8db96f8e17d04274b77f5062dca0df5b0e.tar.gz
nextcloud-server-2bb13a8db96f8e17d04274b77f5062dca0df5b0e.zip
use localised date in notification mails
Diffstat (limited to 'core/ajax')
-rw-r--r--core/ajax/share.php9
1 files changed, 4 insertions, 5 deletions
diff --git a/core/ajax/share.php b/core/ajax/share.php
index 268cd4f53a7..8b48effb458 100644
--- a/core/ajax/share.php
+++ b/core/ajax/share.php
@@ -121,7 +121,7 @@ if (isset($_POST['action']) && isset($_POST['itemType']) && isset($_POST['itemSo
if (isset($items[0]['expiration'])) {
try {
$date = new DateTime($items[0]['expiration']);
- $expiration = $date->format('Y-m-d');
+ $expiration = $l->l('date', $date->getTimestamp());
} catch (Exception $e) {
\OCP\Util::writeLog('sharing', "Couldn't read date: " . $e->getMessage(), \OCP\Util::ERROR);
}
@@ -187,6 +187,8 @@ if (isset($_POST['action']) && isset($_POST['itemType']) && isset($_POST['itemSo
break;
case 'email':
+ // enable l10n support
+ $l = OC_L10N::get('core');
// read post variables
$user = OCP\USER::getUser();
$displayName = OCP\User::getDisplayName();
@@ -199,16 +201,13 @@ if (isset($_POST['action']) && isset($_POST['itemType']) && isset($_POST['itemSo
if (isset($_POST['expiration']) && $_POST['expiration'] !== '') {
try {
$date = new DateTime($_POST['expiration']);
- $expiration = $date->format('Y-m-d');
+ $expiration = $l->l('date', $date->getTimestamp());
} catch (Exception $e) {
\OCP\Util::writeLog('sharing', "Couldn't read date: " . $e->getMessage(), \OCP\Util::ERROR);
}
}
- // enable l10n support
- $l = OC_L10N::get('core');
-
// setup the email
$subject = (string)$l->t('%s shared »%s« with you', array($displayName, $file));