Révision b720ea3e
Ajouté par Assos Assos il y a plus de 8 ans
drupal7/sites/all/modules/date/date.migrate.inc | ||
---|---|---|
40 | 40 |
* @return array |
41 | 41 |
* An array of the defined variables in this scope. |
42 | 42 |
*/ |
43 |
static function arguments($timezone = 'UTC', $timezone_db = 'UTC', $rrule = NULL, $language = NULL) { |
|
43 |
public static function arguments($timezone = 'UTC', $timezone_db = 'UTC', $rrule = NULL, $language = NULL) {
|
|
44 | 44 |
return get_defined_vars(); |
45 | 45 |
} |
46 | 46 |
|
... | ... | |
129 | 129 |
// timestamp for 'now'. |
130 | 130 |
if (empty($from)) { |
131 | 131 |
$return[$language][$delta]['value'] = NULL; |
132 |
$return[$language][$delta]['timezone'] = NULL; |
|
132 | 133 |
if (!empty($field_info['settings']['todate'])) { |
133 | 134 |
$return[$language][$delta]['value2'] = NULL; |
134 | 135 |
} |
... | ... | |
151 | 152 |
case 'datestamp': |
152 | 153 |
// Already done. |
153 | 154 |
break; |
155 |
|
|
154 | 156 |
case 'datetime': |
155 | 157 |
// YYYY-MM-DD HH:MM:SS. |
156 | 158 |
$from = format_date($from, 'custom', 'Y-m-d H:i:s', $timezone); |
... | ... | |
158 | 160 |
$to = format_date($to, 'custom', 'Y-m-d H:i:s', $timezone); |
159 | 161 |
} |
160 | 162 |
break; |
163 |
|
|
161 | 164 |
case 'date': |
162 | 165 |
// ISO date: YYYY-MM-DDTHH:MM:SS. |
163 | 166 |
$from = format_date($from, 'custom', 'Y-m-d\TH:i:s', $timezone); |
... | ... | |
165 | 168 |
$to = format_date($to, 'custom', 'Y-m-d\TH:i:s', $timezone); |
166 | 169 |
} |
167 | 170 |
break; |
171 |
|
|
168 | 172 |
default: |
169 | 173 |
break; |
170 | 174 |
} |
... | ... | |
173 | 177 |
// created. |
174 | 178 |
if (function_exists('date_repeat_build_dates') && !empty($field_info['settings']['repeat']) && $rrule) { |
175 | 179 |
include_once DRUPAL_ROOT . '/' . drupal_get_path('module', 'date_api') . '/date_api_ical.inc'; |
176 |
$item = array('value' => $from, 'value2' => $to, 'timezone' => $timezone); |
|
180 |
$item = array( |
|
181 |
'value' => $from, |
|
182 |
'value2' => $to, |
|
183 |
'timezone' => $timezone, |
|
184 |
); |
|
177 | 185 |
// Can be de-uglified when http://drupal.org/node/1159404 is committed. |
178 | 186 |
$return[$language] = date_repeat_build_dates(NULL, date_ical_parse_rrule($field_info, $rrule), $field_info, $item); |
179 | 187 |
} |
180 | 188 |
else { |
181 | 189 |
$return[$language][$delta]['value'] = $from; |
190 |
$return[$language][$delta]['timezone'] = $timezone; |
|
182 | 191 |
if (!empty($to)) { |
183 | 192 |
$return[$language][$delta]['value2'] = $to; |
184 | 193 |
} |
... | ... | |
190 | 199 |
return $return; |
191 | 200 |
} |
192 | 201 |
|
202 |
/** |
|
203 |
* {@inheritdoc} |
|
204 |
*/ |
|
193 | 205 |
public function fields($migration = NULL) { |
194 | 206 |
return array( |
195 | 207 |
'timezone' => t('Timezone'), |
Formats disponibles : Unified diff
Weekly update of contrib modules