Closed (fixed)
Project:
Date
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
14 Nov 2008 at 20:36 UTC
Updated:
24 Jul 2018 at 10:05 UTC
Jump to comment: Most recent
Hello,
I'm trying to figure out a way to change the label of the date and time how they appear on the node. They only appear as "From Date" and "To Date," and there is no field over time box, and my users won't know to enter the time in that box. Google search only picked up one issue, which actually is the same issue I'm having, but nobody responded to it. That issue is here:
http://drupal.org/node/281112#comment-1108281
I don't mind editing the .module file, but I have looked through the ones that came with the module and I can't seem to find that label anywhere. Can someone point me in the right direction?
Thanks.
Comments
Comment #1
arlinsandbulte commentedNo, I don't think there is any nice way of doing this.
I'll turn this into a feature request and move it to HEAD.
Comment #2
YK85 commentedIs there a way of doing this for 6.x by hook form alter or something?
Right now the label is showing as [ -Year ] [ -Month ] [ -Day ] and I would like to change it to [ Year ] [ Month ] [ Day ]
Is there an example of how to do this somewhere?
Thanks!
Comment #3
iLLin commentedThis is crazy old, but this is how I do things like this.
http://api.drupal.org/api/drupal/developer--topics--forms_api_reference....
Review the api reference and notice the pre_render needs to be an array. I am doing this wrong as if my module was called last and some other module was adding something here, I would reset that array. Just keep that in mind when doing yours.
Comment #4
handsofaten commentedThanks, iLLin. Was having a hell of a time figuring out how to change these values with form alter.
Comment #5
andypostIf date field will allow to change a labels for From-To so we should decide on translation.
Once label is entered so It's a user text which does not translates with locale module
Comment #6
Naiya commentedThanks iLLin. i wanted to change it everywhere, so i added
$form['date_filter']['min']['#title'] = t('From');to my form_alter.
Comment #7
karens commentedI added theme functions for the date and time labels, similar to the theme functions for the year, month, day, etc labels in the select widget. Now you can override theme_date_part_label_date() and theme_date_part_label_time().
Comment #9
alsator commentedThe following example shows the way to change 'Year' label of selectbox of date field.