You are here

function webform_conditional_prepare_date_js in Webform 7.4

Prepare a conditional value for adding as a JavaScript setting.

1 call to webform_conditional_prepare_date_js()
webform_conditional_prepare_time_js in includes/webform.conditionals.inc
Prepare a conditional value for adding as a JavaScript setting.
1 string reference to 'webform_conditional_prepare_date_js'
_webform_conditional_operator_info in includes/webform.conditionals.inc
Implements hook_webform_conditional_operator_info().

File

includes/webform.conditionals.inc, line 1521
Form elements and menu callbacks to provide conditional handling in Webform.

Code

function webform_conditional_prepare_date_js($rule_value) {

  // Convert the time/date string to a UTC timestamp for comparison. Note that
  // this means comparisons against immediate times (such as "now") may be
  // slightly stale by the time the comparison executes. Timestamps are in
  // milliseconds, as to match JavaScript's Date.toString() method.
  $date = webform_strtodate('c', $rule_value, 'UTC');
  return webform_strtotime($date);
}