Skip to content

Commit 44c86c0

Browse files
committed
Do not repeat the same array_merge
1 parent 843b5cf commit 44c86c0

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

cs_date_formatter.module

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ function cs_date_formatter_field_formatter_settings_form($field, $instance, $vie
8989
'long' => t('Long'),
9090
);
9191
$options_sl = array_slice($options_nsl, 1);
92+
$options_num_types = array_merge($options, $options_n2d);
9293

9394
$element['weekday'] = array(
9495
'#type' => 'select',
@@ -99,7 +100,7 @@ function cs_date_formatter_field_formatter_settings_form($field, $instance, $vie
99100
$element['year'] = array(
100101
'#type' => 'select',
101102
'#title' => t('Year display'),
102-
'#options' => array_merge($options, $options_n2d),
103+
'#options' => $options_num_types,
103104
'#default_value' => $settings['year'],
104105
) + $element_commons;
105106
$element['month'] = array(
@@ -111,25 +112,25 @@ function cs_date_formatter_field_formatter_settings_form($field, $instance, $vie
111112
$element['day'] = array(
112113
'#type' => 'select',
113114
'#title' => t('Day display'),
114-
'#options' => array_merge($options, $options_n2d),
115+
'#options' => $options_num_types,
115116
'#default_value' => $settings['day'],
116117
) + $element_commons;
117118
$element['hour'] = array(
118119
'#type' => 'select',
119120
'#title' => t('Hour display'),
120-
'#options' => array_merge($options, $options_n2d),
121+
'#options' => $options_num_types,
121122
'#default_value' => $settings['hour'],
122123
) + $element_commons;
123124
$element['minute'] = array(
124125
'#type' => 'select',
125126
'#title' => t('Minute display'),
126-
'#options' => array_merge($options, $options_n2d),
127+
'#options' => $options_num_types,
127128
'#default_value' => $settings['minute'],
128129
) + $element_commons;
129130
$element['second'] = array(
130131
'#type' => 'select',
131132
'#title' => t('Seconds display'),
132-
'#options' => array_merge($options, $options_n2d),
133+
'#options' => $options_num_types,
133134
'#default_value' => $settings['second'],
134135
) + $element_commons;
135136
$element['timezonename'] = array(

0 commit comments

Comments
 (0)