I know this should be pretty simple, but I've selected Custom date for my Events List and I get nothing out. Where should I be specifying the format of the date?

I'd like it to show:

"Sat 21st Oct"

or failing that:

"Saturday, 21 October, 2006"

No time as it is irrelevant to all day events.

Thanks, James

Comments

jamesbradbury’s picture

The trick was to edit views.module to include the following:

/**
 * Format a date using custom representation.
 */
function views_handler_field_date_custom($fieldinfo, $fielddata, $value, $data) {
  return $value ? format_date($value, 'custom', 'D M jS') : theme_views_nodate();
}
jamesbradbury’s picture

Can anyone tell me which file I should edit to cut out the time from Event Teaser Lists created via the Views module??

beekerstudios’s picture

You could have just entered D M jS in the custom 'Option' field.

See http://us2.php.net/date for more attributes.

That way you are not limiting it for other views. You could have also set a custom field date for the listing as you were talking about but instead of choosing teaser list, do list view and add all of the fields you wish to, including the custom date field. Worked for me. I didn't particularly like the fact that it was showing that the article was submitted by me, which is a more blogg like posting style.

joachim’s picture

This was just what I was looking for!
Thanks :)

beekerstudios’s picture

No problem, I know PHP pretty well, so I was surprised how deep down it let you go, very much in my thinking! Drupal KICKS BOOTY!

deckard97’s picture

Thanks, was looking for that.

jeffrey.dalton’s picture

I have a CCK content type with a Date data type which is awesome. BUT when I try to save a '*Custom date format:' the page submits and won't save the custom format I entered? Anybody have any ideas why this would be?

Jeffrey Dalton
Creative Director & Founding Partner
BKJ Digital
https://bkjdigital.com