I've created an event calendar for my sites following the very instructive and clear screencast created by Sean Effel over at DrupalTherapy (http://www.drupaltherapy.com/node/76). Near the end of screencast (@ 15:11), Sean says that after creating the calender: "We could do some custom formatting to strip out the date ...". (i.e. leaving only the time in the calendar view of the event). However he doesn't tell you how to do this.
I've created the calendar and I want to use a custom format (i.e. "H:i") showing only the time when the event is displayed within the context of the calendar. Any ideas about how to do this?
Comments
Create a new date format
You can go to the page admin/settings/date-time/formats/add to add a custom time format, then assign it to a date format on admin/settings/date-time/formats
Thanks!
SSIA
- gisle
From the Menu
Or, from the menu:
:Drupal -> Administer -> Site Configuration -> Date and Time -> Formats -> Add Format ->
Format string: H:i
This adds a format type to the drop-down selection which is only hours and minutes.
then:
:Drupal -> Administer -> Site Configuration -> Date and Time -> Formats -> Add format type ->
Name: Time only -> Type: timeonly -> Save configuration
then:
:Drupal -> Administer -> Site Configuration -> Date and Time -> Formats -> Configure ->
Time Date format: (the dropdown box should now show your recently created time format, so select it) -> Save configuration
----------------------------------------------
Perspectoff
When all else fails in Drupal, do an update.
kudos to perspectoff
excellent explanation
This works for me, but the
This works for me, but the custom date doesn't show up in the views date field as a possible date format. Any ideas why that is?
As perspectoff writes: When
As perspectoff writes: When all else fails in Drupal, do an update.
- gisle
I think it was just a cache
I think it was just a cache issue. Now it works...
And this way...
The new date format will be applied to all date fields?
I am asking because I wish to apply it only on certain cases and not all over the website.
So how do you apply this new H:i format (after creating it) to only the calendar??