@@ 440-453 (lines=14) @@ | ||
437 | * Used to get the saved offset range start date. |
|
438 | * @return DbSafeDateTime|null |
|
439 | */ |
|
440 | public static function getStartDateRange() |
|
441 | { |
|
442 | $start_date = get_option(self::OPTION_KEY_OFFSET_RANGE_START_DATE, null); |
|
443 | try { |
|
444 | $datetime = DateTime::createFromFormat('U', $start_date, new DateTimeZone('UTC')); |
|
445 | $start_date = $datetime instanceof DateTime |
|
446 | ? DbSafeDateTime::createFromDateTime($datetime) |
|
447 | : null; |
|
448 | ||
449 | } catch (Exception $e) { |
|
450 | $start_date = null; |
|
451 | } |
|
452 | return $start_date; |
|
453 | } |
|
454 | ||
455 | ||
456 | ||
@@ 474-486 (lines=13) @@ | ||
471 | * Used to get the saved offset range end date. |
|
472 | * @return DbSafeDateTime|null |
|
473 | */ |
|
474 | public static function getEndDateRange() |
|
475 | { |
|
476 | $end_date = get_option(self::OPTION_KEY_OFFSET_RANGE_END_DATE, null); |
|
477 | try { |
|
478 | $datetime = DateTime::createFromFormat('U', $end_date, new DateTimeZone('UTC')); |
|
479 | $end_date = $datetime instanceof Datetime |
|
480 | ? DbSafeDateTime::createFromDateTime($datetime) |
|
481 | : null; |
|
482 | } catch (Exception $e) { |
|
483 | $end_date = null; |
|
484 | } |
|
485 | return $end_date; |
|
486 | } |
|
487 | } |
|
488 |