Skip to content

Commit

Permalink
Fixes backdrop-contrib#13: variable_get -> config_get
Browse files Browse the repository at this point in the history
  • Loading branch information
robertgarrigos committed Oct 24, 2024
1 parent 6c21307 commit a285e83
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
7 changes: 7 additions & 0 deletions aggregator.install
Original file line number Diff line number Diff line change
Expand Up @@ -334,3 +334,10 @@ function aggregator_update_last_removed() {
function aggregator_update_1001() {
config_set('aggregator.settings', 'aggregator_ssl_verification', TRUE);
}

/**
* Set default value for date_format setting.
*/
function aggregator_update_1002() {
config_set('aggregator.settings', 'date_format', 'D, m/d/Y - H:i');
}
3 changes: 2 additions & 1 deletion aggregator.pages.inc
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,8 @@ function template_preprocess_aggregator_item(&$variables) {
$variables['source_date'] = t('%ago ago', array('%ago' => format_interval(REQUEST_TIME - $item->timestamp)));
}
else {
$variables['source_date'] = format_date($item->timestamp, 'custom', variable_get('date_format_medium', 'D, m/d/Y - H:i'));
$format = config_get('aggregator.settings', 'date_format');
$variables['source_date'] = format_date($item->timestamp, 'custom', $format);
}

$variables['categories'] = array();
Expand Down
3 changes: 2 additions & 1 deletion config/aggregator.settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@
"feed_item_length": "fulltext",
"teaser_length": 600,
"clear": 9676800,
"aggregator_ssl_verification": true
"aggregator_ssl_verification": true,
"date_format": "D, m/d/Y - H:i"
}

0 comments on commit a285e83

Please sign in to comment.