Se4598 has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/70763


Change subject: getHumanTimestamp() now also returns time for timestamps in 
same year
......................................................................

getHumanTimestamp() now also returns time for timestamps in same year

Previously no time was returned if the timestamp was in the same year.
This leads in a inconsistency for the different stages of a timestamp.

Now a a timestamp should also display the time, which was previously 
missed, in the same format as used for last year.

example:
* "Monday at 14:41" (within a week)
* "16 January 2013" (same year; this output will change)
* "11:24, 19 December 2012" (last year)

Change-Id: I288cc41d4eea399a6ad9cb3c9974cdc7a5c5d5bb
---
M languages/Language.php
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/63/70763/1

diff --git a/languages/Language.php b/languages/Language.php
index 50cb7f7..7016ac5 100644
--- a/languages/Language.php
+++ b/languages/Language.php
@@ -2266,8 +2266,8 @@
                        $format = $this->getDateFormatString( 'both', 
$user->getDatePreference() ?: 'default' );
                        $ts = $this->sprintfDate( $format, $ts->getTimestamp( 
TS_MW ) );
                } elseif ( $days > 5 ) {
-                       // Timestamps are in same year,  but more than 5 days 
ago: show day and month only.
-                       $format = $this->getDateFormatString( 'pretty', 
$user->getDatePreference() ?: 'default' );
+                       // Timestamps are in same year, but more than 5 days 
ago: show also full timestamp
+                       $format = $this->getDateFormatString( 'both', 
$user->getDatePreference() ?: 'default' );
                        $ts = $this->sprintfDate( $format, $ts->getTimestamp( 
TS_MW ) );
                } elseif ( $days > 1 ) {
                        // Timestamp within the past week: show the day of the 
week and time

-- 
To view, visit https://gerrit.wikimedia.org/r/70763
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I288cc41d4eea399a6ad9cb3c9974cdc7a5c5d5bb
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Se4598 <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to