Code Duplication    Length = 12-12 lines in 2 locations

Sources/Calendar.php 1 location

@@ 369-380 (lines=12) @@
366
	}
367
368
	// An all day event? Set up some nice defaults in case the user wants to change that
369
	if ($context['event']['allday'] == true)
370
	{
371
		$context['event']['tz'] = getUserTimezone();
372
		$context['event']['start_time'] = timeformat(time(), $time_string);
373
		$context['event']['end_time'] = timeformat(time() + 3600, $time_string);
374
	}
375
	// Otherwise, just adjust these to look nice on the input form
376
	else
377
	{
378
		$context['event']['start_time'] = timeformat(strtotime($context['event']['start_iso_gmdate']), $time_string);
379
		$context['event']['end_time'] = timeformat(strtotime($context['event']['end_iso_gmdate']), $time_string);
380
	}
381
382
	// Need this so the user can select a timezone for the event.
383
	$context['all_timezones'] = smf_list_timezones($context['event']['start_date']);

Sources/Post.php 1 location

@@ 315-326 (lines=12) @@
312
		$context['event']['last_day'] = (int) strftime('%d', mktime(0, 0, 0, $context['event']['month'] == 12 ? 1 : $context['event']['month'] + 1, 0, $context['event']['month'] == 12 ? $context['event']['year'] + 1 : $context['event']['year']));
313
314
		// An all day event? Set up some nice defaults in case the user wants to change that
315
		if ($context['event']['allday'] == true)
316
		{
317
			$context['event']['tz'] = getUserTimezone();
318
			$context['event']['start_time'] = timeformat(time(), $time_string);
319
			$context['event']['end_time'] = timeformat(time() + 3600, $time_string);
320
		}
321
		// Otherwise, just adjust these to look nice on the input form
322
		else
323
		{
324
			$context['event']['start_time'] = timeformat(strtotime($context['event']['start_iso_gmdate']), $time_string);
325
			$context['event']['end_time'] = timeformat(strtotime($context['event']['end_iso_gmdate']), $time_string);
326
		}
327
328
		// Need this so the user can select a timezone for the event.
329
		$context['all_timezones'] = smf_list_timezones($context['event']['start_date']);