Closed (fixed)
Project:
Date
Version:
7.x-2.x-dev
Component:
Views Filter
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
21 Jul 2011 at 16:08 UTC
Updated:
17 Aug 2011 at 17:21 UTC
I've been at this all day and can't nail it.
I want to remove the hyphen from in -Year, -Month etc. and capitalize the words.
I created a custom module but can't identify the correct variables in the: $form[] = t('')
Anyone done this before successfully...?
Thanks for any help.
<?php
/**
* Change default labels on Date dropdown menus, e.g. -Year, -Month, -Day, etc.
*/
function date_label_changer_form_alter(&$form, &$form_state, $form_id) {
if ($form_id == 'views_exposed_form' && $form['#id'] == 'views-exposed-form-worldmap-page-1') {
$form['date_filter']['min']['year']['#label'] = t('YEAR');
}
}
Comments
Comment #1
karens commentedDon't remove the hypen, the code uses it to detect that this is not an actual value for the field. The text, other than the hypen, is controlled by individual themes like date_part_label_year(). See them in date/date_api/theme/theme.inc
Comment #2
cajmcmahon commentedCool! Thank you.