/**
* Used by date() and time() to adjust the time output.
*
- * @param int $ts The time in date('YmdHis') format
+ * @param string $ts The time in date('YmdHis') format
* @param mixed $tz Adjust the time by this amount (default false, mean we
* get user timecorrection setting)
* @return int
}
/**
- * @param mixed $ts The time format which needs to be turned into a
+ * @param string $ts The time format which needs to be turned into a
* date('YmdHis') format with wfTimestamp(TS_MW,$ts)
* @param bool $adj Whether to adjust the time output according to the
* user configured offset ($timecorrection)
}
/**
- * @param mixed $ts The time format which needs to be turned into a
+ * @param string $ts The time format which needs to be turned into a
* date('YmdHis') format with wfTimestamp(TS_MW,$ts)
* @param bool $adj Whether to adjust the time output according to the
* user configured offset ($timecorrection)
}
/**
- * @param mixed $ts The time format which needs to be turned into a
+ * @param string $ts The time format which needs to be turned into a
* date('YmdHis') format with wfTimestamp(TS_MW,$ts)
* @param bool $adj Whether to adjust the time output according to the
* user configured offset ($timecorrection)
* Internal helper function for userDate(), userTime() and userTimeAndDate()
*
* @param string $type Can be 'date', 'time' or 'both'
- * @param mixed $ts The time format which needs to be turned into a
+ * @param string $ts The time format which needs to be turned into a
* date('YmdHis') format with wfTimestamp(TS_MW,$ts)
* @param User $user User object used to get preferences for timezone and format
* @param array $options Array, can contain the following keys:
class TimeAdjustTest extends MediaWikiLangTestCase {
protected function setUp() {
parent::setUp();
-
- $this->iniSet( 'precision', 15 );
}
/**
$this->setMwGlobals( 'wgLocalTZoffset', $localTZoffset );
$this->assertEquals(
- strval( $expected ),
+ $expected,
strval( $wgContLang->userAdjust( $date, '' ) ),
"User adjust {$date} by {$localTZoffset} minutes should give {$expected}"
);
public static function dataUserAdjust() {
return array(
- array( 20061231235959, 0, 20061231235959 ),
- array( 20061231235959, 5, 20070101000459 ),
- array( 20061231235959, 15, 20070101001459 ),
- array( 20061231235959, 60, 20070101005959 ),
- array( 20061231235959, 90, 20070101012959 ),
- array( 20061231235959, 120, 20070101015959 ),
- array( 20061231235959, 540, 20070101085959 ),
- array( 20061231235959, -5, 20061231235459 ),
- array( 20061231235959, -30, 20061231232959 ),
- array( 20061231235959, -60, 20061231225959 ),
+ array( '20061231235959', 0, '20061231235959' ),
+ array( '20061231235959', 5, '20070101000459' ),
+ array( '20061231235959', 15,'20070101001459' ),
+ array( '20061231235959', 60, '20070101005959' ),
+ array( '20061231235959', 90, '20070101012959' ),
+ array( '20061231235959', 120, '20070101015959' ),
+ array( '20061231235959', 540, '20070101085959' ),
+ array( '20061231235959', -5, '20061231235459' ),
+ array( '20061231235959', -30, '20061231232959' ),
+ array( '20061231235959', -60, '20061231225959' ),
);
}
}