You are here

function date_api_json in Date 5.2

Backport of drupal_json().

1 call to date_api_json()
user_timezone in date_timezone/date_timezone.module
Menu callback; Retrieve a JSON object containing a suggested time zone name.

File

./date_api.module, line 1577
This module will make the date API available to other modules. Designed to provide a light but flexible assortment of functions and constants, with more functionality in additional files that are not loaded unless other modules specifically include them.

Code

function date_api_json($var = NULL) {

  // We are returning javascript, so tell the browser.
  drupal_set_header('Content-Type: text/javascript; charset=utf-8');
  if (isset($var)) {
    echo drupal_to_js($var);
  }
}