Removing DatediffModifier (duplicate of Date_D_iffModifier)
authorTim Düsterhus <duesterhus@woltlab.com>
Tue, 16 Oct 2012 16:45:20 +0000 (18:45 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Tue, 16 Oct 2012 16:45:20 +0000 (18:45 +0200)
Fixes #852

wcfsetup/install/files/lib/system/template/plugin/DatediffModifierTemplatePlugin.class.php [deleted file]

diff --git a/wcfsetup/install/files/lib/system/template/plugin/DatediffModifierTemplatePlugin.class.php b/wcfsetup/install/files/lib/system/template/plugin/DatediffModifierTemplatePlugin.class.php
deleted file mode 100644 (file)
index c3ac5dc..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-<?php
-namespace wcf\system\template\plugin;
-use wcf\system\template\TemplateEngine;
-use wcf\util\DateUtil;
-
-/**
- * The 'dateDiff' modifier calculates the difference between two unix timestamps
- * and returns it as a textual date interval. The second parameter $fullInterval
- * indicates if the full difference is returned or just a rounded difference.
- * 
- * Usage:
- * {$timestamp|dateDiff}
- * {"123456789"|dateDiff:$timestamp:$fullInverval}
- *
- * @author     Matthias Schmidt, Marcel Werk
- * @copyright  2001-2012 WoltLab GmbH
- * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @package    com.woltlab.wcf
- * @subpackage system.template.plugin
- * @category   Community Framework
- */
-class DateDiffModifierTemplatePlugin implements IModifierTemplatePlugin {
-       /**
-        * @see wcf\system\template\IModifierTemplatePlugin::execute()
-        */
-       public function execute($tagArgs, TemplateEngine $tplObj) {
-               if (!isset($tagArgs[1])) {
-                       $tagArgs[1] = TIME_NOW;
-               }
-               
-               $fullInterval = false;
-               if (isset($tagArgs[2])) {
-                       $fullInterval = $tagArgs[2];
-               }
-               
-               $startTime = DateUtil::getDateTimeByTimestamp(min($tagArgs[0], $tagArgs[1]));
-               $endTime = DateUtil::getDateTimeByTimestamp(max($tagArgs[0], $tagArgs[1]));
-               
-               return DateUtil::formatInterval($endTime->diff($startTime), $fullInterval);
-       }
-}