Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I'm looking for a way in Views to abbreviate or shorten the date listed at the top of the block for the Calendar module. Currently it shows the full date like:
Monday, December 1
and I would like to show:
Mon, Dec 1
...as shown in the attached screenshot. Is there a setting for this in Views or does that have to be accessed via a hook? Any help is appreciated. Thanks.
Comment | File | Size | Author |
---|---|---|---|
calendar-date-abbr.jpg | 28.12 KB | rajmataj | |
calendar-date-normal.jpg | 28.93 KB | rajmataj |
Comments
Comment #1
rajmataj CreditAttribution: rajmataj commented(Answering for my own and other's benefit) This is actually related to the Date module. You can take a copy of the function that starts as
function theme_date_nav_title($params) {
which is found insites/all/modules/contrib/date/date_views/theme/theme.inc
(7.x-2.8) and adjust the PHP date format to suit your needs, putting the resulting code in your own template.php file. In my case, I altered this:$format_without_year = variable_get('date_views_' . $granularity . 'format_without_year', 'l, F j');
...to be:
$format_without_year = variable_get('date_views_' . $granularity . 'format_without_year', 'D, M j');
If anyone knows of another way, please feel to mention here. Thanks.