I would like to see generally used day abbreviations (like "Mon" or "Tue"). Perhaps being able to set each day's abbreviation would be the most flexible for people with varying calendar sizes, so for example someone could just use "M" or "T" if they're making a very small calendar block. Opinions?
Comments
Comment #1
skilip commentedHi jmstacey,
It's currently not possible to change the weekday titles using hook_calendar, but I think it will be relatively easy to add 'alter weekdays' functionality in the hook function. I'm planning to add a configuration option which allowes you to set the first day of the week. When I do I'll take your request with it and release a new version.
For now, you can just change the weekdays in the calendar_block.module. I'll let you know when I'm done.
Comment #2
skilip commentedHey,
The new version is released which enables you to change the text used in the weekdays. Please refer to the help section of the new release for an usage example.
Cheers!
Comment #3
dubitable commentedWhile I appreciate that you've provided a way to customize these abbreviations, it's still not clear to me how this is possible outside of writing a new module that uses the calendar block. Is there any way to change these abbreviations inside of the theme, say in template.php? Am I just not understanding how this works?
Thanks!
Best,
Dave
Comment #4
jmstacey commentedThanks for the update skilip. The example in the documentation might want to be changed to something similar to the example below. If $calendar->weekdays = array(... is used, the order that was chosen through the interface will be overridden. This is not a problem but might catch people unawares. Changing the values in place would be more generic. Just a tip since I didn't catch what I was doing until I noticed that the order was no longer the one I had chosen in the interface.
@Dave, In the current version you have to use a separate module. Here is an example of how I do it:
Comment #5
skilip commented@Dave,
As jmstacey mentioned, the calendar block is only written to be used by other modules. You already need an other module to create links on the calendar, so IMHO there's no point to create a separate configuration setting for day abbreviations.
In the future I will extend the module with a checkbox in node forms, which let users choose whether or not to display a link to the node in he calendar block. If that's done, the configuration setting for day abbreviations may be more useful.
All the best!
Comment #6
skilip commented@ jmstacey,
Thanks for your suggestion! I think it's better to use a separate default weekdays array to be used for the order, instead of using the weekdays array returned by hook_calendar_block. This ensures that other modules cannot mess up the order of weekdays. I'll take this into a next version.
Thanks again!
Comment #8
skilip commentedSee #715814: Improved i18n support by requiring Date API