You are here

function quiz_translate_form_date in Quiz 7.6

Same name and namespace in other branches
  1. 8.4 quiz_datetime.inc \quiz_translate_form_date()
  2. 5.2 quiz_datetime.inc \quiz_translate_form_date()
  3. 5 quiz_datetime.inc \quiz_translate_form_date()
  4. 6.6 quiz_datetime.inc \quiz_translate_form_date()
  5. 6.2 quiz_datetime.inc \quiz_translate_form_date()
  6. 6.3 quiz_datetime.inc \quiz_translate_form_date()
  7. 6.4 quiz_datetime.inc \quiz_translate_form_date()
  8. 6.5 quiz_datetime.inc \quiz_translate_form_date()
  9. 7 quiz_datetime.inc \quiz_translate_form_date()
  10. 7.4 quiz_datetime.inc \quiz_translate_form_date()
  11. 7.5 quiz.module \quiz_translate_form_date()

Handles the start and end times in a node form submission.

Parameters

$node The submitted node with form data.:

$date The name of the date ('quiz_open' or 'quiz_close') to translate.:

1 call to quiz_translate_form_date()
_quiz_common_presave_actions in ./quiz.module
Common actions that need to be done before a quiz is inserted or updated

File

./quiz.module, line 3921
quiz.module Main file for the Quiz module.

Code

function quiz_translate_form_date(&$node, $date) {
  $human = $node->{$date};
  if (strtotime($human) !== FALSE) {
    $timestamp = strtotime($human);
    $node->{$date} = $timestamp;
  }
}