Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthieu Aubry <matt@piwik.org>2015-10-02 07:13:29 +0300
committerMatthieu Aubry <matt@piwik.org>2015-10-02 07:13:29 +0300
commita2f71ab833b60076e8cfceec9b18e76f74458e94 (patch)
treeda3acefffc6a0ef9dbb534f5cdb9b0b7e37c4a3e /plugins/Live
parent38fbe34d4dd8ba7fa3897461b61098d4b3a83252 (diff)
parent1c49540fc8f259e05dd838bb4a3f7cf3b26078dc (diff)
Merge pull request #8856 from piwik/dateformats
Improve date & time formats
Diffstat (limited to 'plugins/Live')
-rw-r--r--plugins/Live/API.php8
-rw-r--r--plugins/Live/Visitor.php2
-rw-r--r--plugins/Live/VisitorProfile.php2
3 files changed, 6 insertions, 6 deletions
diff --git a/plugins/Live/API.php b/plugins/Live/API.php
index 63ef0bbbd2..9d02eac3ee 100644
--- a/plugins/Live/API.php
+++ b/plugins/Live/API.php
@@ -317,13 +317,13 @@ class API extends \Piwik\Plugin\API
$dateTimeVisit = Date::factory($visitorDetailsArray['lastActionTimestamp'], $timezone);
if ($dateTimeVisit) {
- $visitorDetailsArray['serverTimePretty'] = $dateTimeVisit->getLocalized('%time%');
- $visitorDetailsArray['serverDatePretty'] = $dateTimeVisit->getLocalized(Piwik::translate('CoreHome_DateFormat'));
+ $visitorDetailsArray['serverTimePretty'] = $dateTimeVisit->getLocalized(Date::TIME_FORMAT);
+ $visitorDetailsArray['serverDatePretty'] = $dateTimeVisit->getLocalized(Date::DATE_FORMAT_LONG);
}
$dateTimeVisitFirstAction = Date::factory($visitorDetailsArray['firstActionTimestamp'], $timezone);
- $visitorDetailsArray['serverDatePrettyFirstAction'] = $dateTimeVisitFirstAction->getLocalized(Piwik::translate('CoreHome_DateFormat'));
- $visitorDetailsArray['serverTimePrettyFirstAction'] = $dateTimeVisitFirstAction->getLocalized('%time%');
+ $visitorDetailsArray['serverDatePrettyFirstAction'] = $dateTimeVisitFirstAction->getLocalized(Date::DATE_FORMAT_LONG);
+ $visitorDetailsArray['serverTimePrettyFirstAction'] = $dateTimeVisitFirstAction->getLocalized(Date::TIME_FORMAT);
$visitorDetailsArray['actionDetails'] = array();
if (!$doNotFetchActions) {
diff --git a/plugins/Live/Visitor.php b/plugins/Live/Visitor.php
index 341ac590c9..a330f3ea3a 100644
--- a/plugins/Live/Visitor.php
+++ b/plugins/Live/Visitor.php
@@ -426,7 +426,7 @@ class Visitor implements VisitorInterface
// Convert datetimes to the site timezone
$dateTimeVisit = Date::factory($details['serverTimePretty'], $timezone);
- $details['serverTimePretty'] = $dateTimeVisit->getLocalized(Piwik::translate('CoreHome_ShortDateFormat') . ' %time%');
+ $details['serverTimePretty'] = $dateTimeVisit->getLocalized(Date::DATETIME_FORMAT_SHORT);
$details['timestamp'] = $dateTimeVisit->getTimestamp();
}
diff --git a/plugins/Live/VisitorProfile.php b/plugins/Live/VisitorProfile.php
index 36ab1bce72..58201a3f9f 100644
--- a/plugins/Live/VisitorProfile.php
+++ b/plugins/Live/VisitorProfile.php
@@ -97,7 +97,7 @@ class VisitorProfile
$serverDate = $visit->getColumn('firstActionTimestamp');
return array(
'date' => $serverDate,
- 'prettyDate' => Date::factory($serverDate)->getLocalized(Piwik::translate('CoreHome_DateFormat')),
+ 'prettyDate' => Date::factory($serverDate)->getLocalized(Date::DATE_FORMAT_LONG),
'daysAgo' => (int)Date::secondsToDays($today->getTimestamp() - Date::factory($serverDate)->getTimestamp()),
'referrerType' => $visit->getColumn('referrerType'),
'referralSummary' => self::getReferrerSummaryForVisit($visit),