FAQ | This is a LIVE service | Changelog

Skip to content
Snippets Groups Projects
Commit e79cd2c2 authored by Chris Wilkinson's avatar Chris Wilkinson
Browse files

Merge pull request #16 from thewilkybarkid/date-formats

Set date formats to UK style
parents 60a53ecc 6f1d9d71
No related branches found
No related tags found
No related merge requests found
......@@ -472,3 +472,12 @@ function cambridge_update_7106() {
}
filter_formats_reset();
}
/**
* Set date formats to UK style.
*/
function cambridge_update_7107() {
require_once 'cambridge_base.inc';
cambridge_base_set_up_date_formats();
}
......@@ -572,6 +572,9 @@ function cambridge_base_install() {
// Set some sensible defaults for the Views module.
variable_set('views_ui_show_advanced_help_warning', 0);
// Set date formats to UK style.
cambridge_base_set_up_date_formats();
}
/**
......@@ -646,3 +649,32 @@ function cambridge_base_set_up_focus_on_teasers() {
field_update_instance($instance);
}
}
/**
* Set date formats to UK style.
*/
function cambridge_base_set_up_date_formats() {
if (TRUE === module_exists('locale')) {
// Something has been done with locales, so abort.
return;
}
if ('Europe/London' !== variable_get('date_default_timezone', 'Europe/London')) {
return;
}
if (
'l, F j, Y - H:i' !== variable_get('date_format_long', 'l, F j, Y - H:i')
||
'D, m/d/Y - H:i' !== variable_get('date_format_medium', 'D, m/d/Y - H:i')
||
'm/d/Y - H:i' !== variable_get('date_format_short', 'm/d/Y - H:i')
) {
// One of the Drupal defaults has changed, so abort.
return;
}
variable_set('date_format_long', 'l, j F, Y - H:i');
variable_set('date_format_medium', 'D, d/m/Y - H:i');
variable_set('date_format_short', 'd/m/Y - H:i');
}
......@@ -26,3 +26,12 @@ function cambridge_lite_update_7100() {
cambridge_base_set_up_focus_on_teasers();
}
/**
* Set date formats to UK style.
*/
function cambridge_lite_update_7101() {
require_once 'cambridge_base.inc';
cambridge_base_set_up_date_formats();
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment