Santhosh has uploaded a new change for review.

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

Change subject: CXStats: Fix incorrect week step in the graphs
......................................................................

CXStats: Fix incorrect week step in the graphs

A step with label 2015-12-31 was added as week end date.
And then 2016-01-03 also added as week end date.

The issue is that PHP's Y and M format does not go together:

php > echo date("Y-W", mktime(0,0,0,01,01,2016));
2016-53

To achieve the https://en.wikipedia.org/wiki/ISO_8601#Week_dates
we need to use 'o'.

php > echo date("o-W", mktime(0,0,0,01,01,2016));
2015-53

Bug: T122642
Change-Id: If045b0dcf399db847061905d57e1dbb1f625c7d8
---
M api/ApiQueryContentTranslationLanguageTrend.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ContentTranslation 
refs/changes/18/261618/1

diff --git a/api/ApiQueryContentTranslationLanguageTrend.php 
b/api/ApiQueryContentTranslationLanguageTrend.php
index 2ade9f4..96572a3 100644
--- a/api/ApiQueryContentTranslationLanguageTrend.php
+++ b/api/ApiQueryContentTranslationLanguageTrend.php
@@ -92,7 +92,7 @@
                        if ( $interval === 'month' ) {
                                $uniq = $label = date( 'Y-m', $min );
                        } else {
-                               $uniq = date( 'Y-W', $min );
+                               $uniq = date( 'o-W', $min );
                                $label = date( 'Y-m-d', $min );
                        }
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If045b0dcf399db847061905d57e1dbb1f625c7d8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ContentTranslation
Gerrit-Branch: master
Gerrit-Owner: Santhosh <[email protected]>

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

Reply via email to