Fixed a bug that custom "interval values" had not been used as default

module interval (you can add custom ones at 'visual styles' configuration).
This commit is contained in:
Hirofumi Kosaka 2016-03-22 13:25:15 +09:00
parent 2b583ae7fc
commit 4efc510e6c
1 changed files with 10 additions and 1 deletions

View File

@ -703,6 +703,15 @@ function html_print_extended_select_for_time ($name, $selected = '',
$fields = get_periods();
if ( ! $selected ) {
foreach( $fields as $t_key => $t_value){
if ( $t_key != -1 ) { // -1 means 'custom'
$selected = $t_key;
break;
}
}
}
if (($selected !== false) && (!isset($fields[$selected]) && $selected != 0)) {
$fields[$selected] = human_time_description_raw($selected,true);
}