You are here

public function countdown_box::options_submit in Countdown 7.2

Implementation of boxes_box::options_submit().

File

plugins/countdown_box.inc, line 126

Class

countdown_box
Countdown box.

Code

public function options_submit($form, $form_state) {

  // Convert the given date and time to UTC for storage.
  // Make a date object from the given time, with the site's default timezone.
  $date = new dateObject($this->options['countdown_target'], date_default_timezone_object());

  // Convert the date to UTC.
  $date
    ->setTimezone(new DateTimeZone('UTC'));

  // Set it back into the box options.
  $this->options['countdown_target'] = $date
    ->format(DATE_FORMAT_DATETIME);
}