Yaron Koren has uploaded a new change for review.

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

Change subject: Removed SMW date parsing - now all parsing done with strtotime()
......................................................................

Removed SMW date parsing - now all parsing done with strtotime()

Change-Id: Ia377fcdcd77221527d9696b7bef8fb73699a0d6f
---
M includes/forminputs/SF_DateInput.php
1 file changed, 1 insertion(+), 35 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SemanticForms 
refs/changes/94/266494/1

diff --git a/includes/forminputs/SF_DateInput.php 
b/includes/forminputs/SF_DateInput.php
index 4a199c5..d026498 100644
--- a/includes/forminputs/SF_DateInput.php
+++ b/includes/forminputs/SF_DateInput.php
@@ -73,41 +73,7 @@
                        return array( $year, $month, $day );
                }
 
-               if ( class_exists( 'SMWTimeValue' ) ) {
-                       return self::parseDateSMW( $date );
-               } else {
-                       return self::parseDateNonSMW( $date );
-               }
-       }
-
-       static function parseDateSMW( $date ) {
-               $day = null;
-               $month = null;
-               $actual_date = new SMWTimeValue( '_dat' );
-               $actual_date->setUserValue( $date );
-               $year = $actual_date->getYear();
-               // TODO - "BC" should be an i18n message.
-               if ( $year < 0 ) {
-                       $year = ( $year * - 1 + 1 ) . ' BC';
-               }
-               // Use precision of the date to determine whether we should
-               // also set the month and day.
-               if ( method_exists( $actual_date->getDataItem(), 'getPrecision' 
) ) {
-                       $precision = 
$actual_date->getDataItem()->getPrecision();
-                       if ( $precision > SMWDITime::PREC_Y ) {
-                               $month = $actual_date->getMonth();
-                       }
-                       if ( $precision > SMWDITime::PREC_YM ) {
-                               $day = $actual_date->getDay();
-                       }
-               } else {
-                       // There's some sort of error - make everything blank.
-                       $year = null;
-               }
-               return array( $year, $month, $day );
-       }
-
-       static function parseDateNonSMW( $date ) {
+               // All other dates.
                if ( ctype_digit( $date ) ) {
                        return array( $date, null, null );
                }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia377fcdcd77221527d9696b7bef8fb73699a0d6f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SemanticForms
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren <[email protected]>

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

Reply via email to