[MediaWiki-commits] [Gerrit] mediawiki...Cargo[master]: Fix for calendar display of date function

2017-11-10 Thread Yaron Koren (Code Review)
Yaron Koren has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/390472 )

Change subject: Fix for calendar display of date function
..


Fix for calendar display of date function

Change-Id: I80650636ecfdbb054241a13bd4cd9f79a9cc545e
---
M specials/CargoExport.php
1 file changed, 10 insertions(+), 1 deletion(-)

Approvals:
  Yaron Koren: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/specials/CargoExport.php b/specials/CargoExport.php
index 3501d91..c642256 100644
--- a/specials/CargoExport.php
+++ b/specials/CargoExport.php
@@ -157,7 +157,16 @@
$startDateField = $dateFieldAliases[0];
$startDate = $queryResult[$startDateField];
$startDatePrecisionField = $startDateField . 
'__precision';
-   $startDatePrecision = 
$queryResult[$startDatePrecisionField];
+   // There might not be a precision field, if,
+   // for instance, the date field is an SQL
+   // function. Ideally we would figure out
+   // the right precision, but for now just
+   // go with "DATE_ONLY" - seems safe.
+   if ( array_key_exists( 
$startDatePrecisionField, $queryResult ) ) {
+   $startDatePrecision = 
$queryResult[$startDatePrecisionField];
+   } else {
+   $startDatePrecision = 
CargoStore::DATE_ONLY;
+   }
$curEvent = array(
// Get first field for the title - not
// necessarily the page name.

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I80650636ecfdbb054241a13bd4cd9f79a9cc545e
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Cargo
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 
Gerrit-Reviewer: Yaron Koren 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...Cargo[master]: Fix for calendar display of date function

2017-11-10 Thread Yaron Koren (Code Review)
Yaron Koren has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/390472 )

Change subject: Fix for calendar display of date function
..

Fix for calendar display of date function

Change-Id: I80650636ecfdbb054241a13bd4cd9f79a9cc545e
---
M specials/CargoExport.php
1 file changed, 10 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Cargo 
refs/changes/72/390472/2

diff --git a/specials/CargoExport.php b/specials/CargoExport.php
index 3501d91..c642256 100644
--- a/specials/CargoExport.php
+++ b/specials/CargoExport.php
@@ -157,7 +157,16 @@
$startDateField = $dateFieldAliases[0];
$startDate = $queryResult[$startDateField];
$startDatePrecisionField = $startDateField . 
'__precision';
-   $startDatePrecision = 
$queryResult[$startDatePrecisionField];
+   // There might not be a precision field, if,
+   // for instance, the date field is an SQL
+   // function. Ideally we would figure out
+   // the right precision, but for now just
+   // go with "DATE_ONLY" - seems safe.
+   if ( array_key_exists( 
$startDatePrecisionField, $queryResult ) ) {
+   $startDatePrecision = 
$queryResult[$startDatePrecisionField];
+   } else {
+   $startDatePrecision = 
CargoStore::DATE_ONLY;
+   }
$curEvent = array(
// Get first field for the title - not
// necessarily the page name.

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I80650636ecfdbb054241a13bd4cd9f79a9cc545e
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Cargo
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits