Hardcoded day/month/week output format for theme_date_nav_title()
prunelle - January 6, 2009 - 15:45
| Project: | Date |
| Version: | 6.x-2.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
For a site in French language (use of locale module) I haven't found how I can get the following display (Vendredi 6 Janvier 2009) for the "day title" of the page when I click on a day within a calendar in a block. I've attached both a capture of the date/time administration settings and the page output of the current day from my calendar.
Apart of this request, I would mention that I haven't found any right template for the usual french ouput of a long date, in the administration settings, that is for today : Vendredi 6 Janvier 2009, without any comma.
I've just upgraded my site from 1.x to 2.x.It is working fine. Thank you a lot for such a great work !
| Attachment | Size |
|---|---|
| DateHeureSettings.png | 61.39 KB |
| CalenderDayOutput.png | 27.62 KB |

#1
Is this issue still active? I've got the same problem (with latest 2.x-dev Calendar and Date modules)
Regards
#2
I've done further investigations..
I found that "function theme_date_nav_title()" (inside date/theme/theme.inc file) hard-coded the outputed date format for day/week/month titles.
Maybe the right way to retrieve the right format is to have an option in the calendar view, or something that can be used with i18n (I mean different day title for different country conventions).
For now I re-hardcoded my setting and solved my issue, but I know that it's the worst way to go.. :)
#3
Now that we have our new locale-friendly system for managing date formats we probably should use them in the titles, so I agree this is needed.
Unfortunately I don't really have time to work on it right now, but maybe some will make a patch to let you identify which format should be used for the titles (our new date format system will then automatically handle the locale-switching).
#4
KarenS: if you can point me to the "new locale-friendly system for managing date formats" I can try to provide a patch. I only managed to get the "long" format (that should be locale-safe), but I can't remove the "hour:minutes" parts.
Is in Date_API something usefull to remove a format sub-part?
Thank you
Regards
#5
subscribing
#6
tracking
#7
@ thePanz:
You can copy the code in your template.php & change the beginning of the function name: "theme_..." into "YOUR_THEME_NAME_...".
Drupal will use the function in template.php, so no changing needed in the module.
#8
hi,... it didn´t work to me.
my template´s name is CES, as you can see here:
; $Id: ces.info,v 1.5 2007/07/01 23:27:32 goba Exp $
name = CES
so, I copy the theme_date_nav_title from date module and past that into /themes/ces/template.php and renamed that to
CES_date_nav_title.
nothing happens. I try just to put some ECHO to display anything, but nothing happens. Could you help me?
My callendar displays a wrong month, so I want to fix that in that function.
thanks
#9
did you clear cache ?