From 3df2fd39c85f4b3884c01a8b3493c2c8bd3c4a67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Sat, 10 Dec 2011 16:52:40 +0100 Subject: [PATCH] Attempt to fix option-type --- file/lib/system/option/TimeIntervalOptionType.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/file/lib/system/option/TimeIntervalOptionType.php b/file/lib/system/option/TimeIntervalOptionType.php index 3cf5558..2178083 100644 --- a/file/lib/system/option/TimeIntervalOptionType.php +++ b/file/lib/system/option/TimeIntervalOptionType.php @@ -17,4 +17,15 @@ class TimeIntervalOptionType extends TextOptionType { public function getData(\wcf\data\option\Option $option, $newValue) { return \wcf\util\ChatUtil::timeModifier($newValue); } + + /** + * @see wcf\system\option\TextOptionType::getFormElement() + */ + public function getFormElement(\wcf\data\option\Option $option, $value) { + $tmp = (int) ($value / 60); + if ($value % 60 != 0) { + $tmp .= ','.($tmp % 60).'s'; + } + parent::getFormElement($option, $tmp); + } }