You are here

function date_api_set_variables in Date 7.2

Same name and namespace in other branches
  1. 5.2 date_api.install \date_api_set_variables()
  2. 6.2 date_api.install \date_api_set_variables()
  3. 7.3 date_api/date_api.install \date_api_set_variables()
  4. 7 date_api/date_api.install \date_api_set_variables()

Helper function for setting Date variables.

2 calls to date_api_set_variables()
date_api_enable in date_api/date_api.install
Implements hook_enable().
date_api_install in date_api/date_api.install
Implements hook_install().

File

date_api/date_api.install, line 11
Install, update and uninstall functions for the date_api module.

Code

function date_api_set_variables() {

  // Set absolute minimum and maximum year for dates on this site.
  // There is actually no maximum and minimum year in PHP 5, but a date with
  // a year less than 0 would result in negative ISO and DATETIME dates,
  // like -1250-01-01T00:00:00, which probably won't make sense or work
  // correctly anywhere.
  // The odd construct of using variable_get() instead of variable_set()
  // is so we don't accidentally write over an existing value. If
  // no value is set, variable_get() will set it.
  variable_get('date_max_year', 4000);
  variable_get('date_min_year', 1);
  variable_get('date_php_min_year', 1901);

  // Set an API version in a way that other modules can test for compatibility.
  variable_set('date_api_version', '7.2');
}