CC-4642: Default Fade preference should be in seconds and tenths, rather than millionths

-fixed
This commit is contained in:
denise 2012-11-02 15:51:36 -04:00
parent ba1f6ed054
commit 796274e4ef
2 changed files with 7 additions and 7 deletions

View File

@ -15,7 +15,7 @@ class Application_Form_GeneralPreferences extends Zend_Form_SubForm
$defaultFade = Application_Model_Preference::GetDefaultFade();
if ($defaultFade == "") {
$defaultFade = '0.500000';
$defaultFade = '0.5';
}
//Station name
@ -37,8 +37,8 @@ class Application_Form_GeneralPreferences extends Zend_Form_SubForm
'required' => false,
'filters' => array('StringTrim'),
'validators' => array(array('regex', false,
array('/^[0-9]{1,2}(\.\d{1,6})?$/',
'messages' => 'enter a time in seconds 0{.000000}'))),
array('/^[0-9]{1,2}(\.\d{1})?$/',
'messages' => 'enter a time in seconds 0{.0}'))),
'value' => $defaultFade,
'decorators' => array(
'ViewHelper'

View File

@ -189,8 +189,8 @@ class Application_Model_Preference
$fade = self::getValue("default_fade");
if ($fade === "") {
// the default value of the fade is 00.500000
return "00.500000";
// the default value of the fade is 00.5
return "00.5";
}
// we need this function to work with 2.0 version on default_fade value in cc_pref
@ -204,9 +204,9 @@ class Application_Model_Preference
$fade = $out;
}
$fade = number_format($fade, 6);
$fade = number_format($fade, 2);
//fades need 2 leading zeros for DateTime conversion
$fade = str_pad($fade, 9, "0", STR_PAD_LEFT);
$fade = rtrim(str_pad($fade, 5, "0", STR_PAD_LEFT), "0");
return $fade;
}