By stpaultim on
I'm using caledar module to display class schedule on a calendar. Right now, I'm displaying the time and date of each class on the calendar. However, the date information is redundant, because its already listed on the calendar by date.
In other words, in the little calendar box labeled April 30th, the text reads "Friday, April 30, 2010 - 19:00." All I need it to read, is "19:00." I can see how to display the day without the time, but I can't see how to display the time, without the day.
Any ideas?
Tim
Comments
I think the calendar module
I think the calendar module uses views to display the calendar and dates etc. I think you'll need to edit the calendar view and look at the fields that are output for the page/block that you want to change.
Yes, I am using the calendar
Yes, I am using the calendar module to display the events, which is using Views.
There is an option to "rewrite" the output of the date field that is displaying, but I don't have any idea what to write in that box that would give me the output I desire, which is simply the Time of the event.
If there is another way, I can't yet figure it out. I'm very new to both the Calendar module and Views. But, I continue to experiment as I wait for any suggestions.
Thanks,
Custom Date
You'll need to create a custom date for this purpose. /admin/settings/date-time/formats/add
You want to give it custom time of G:i
Once you've created the custom date, it will be selectable in your calendar view under fields.
I'll take a look at this
I'll take a look at this option, thanks.
Thanks, this got me one step
Thanks, this got me one step further, but not all the way. I was able to successfully show the time that the node was last 'Updated' using my custom date format.
However, I'm not given that option when displaying the time of my event. I've tried creating the time for my event as "Date," DateTime," and "DateStamp." None of them work.
The time of the event has been created as a field (using all three options) of a node. The events themselves are being listed as nodes.
When I try to display the time field in Views, I'm selecting "Content: Class date (field_class_date) - From date." Then, my only choices for "format" are: 'As time ago," "long," "medium," and "short."
Any more ideas?
OK, I figured it out. Rather,
OK, I figured it out. Rather, I took a few hours break, came back did some more searching and found someone else had a similar problem and left a note pointing here:
http://drupal.org/node/277077#comment-1579510
It turns out I had not quite finished creating my own custom date type, the process was a bit more involved than it appeared. Also, it may help to clear your cache.
Thanks all for the great work on Drupal.
One more step on this issue
Thank you, Tim and edenfield, for posting this information. I was trying to do the exact same thing while setting up the "calendar" view to display my Events, and had exactly the same problem that Tim faced.
After I performed all of the steps you mentioned and referenced, I was still seeing the event date-time displayed in the "Medium" date format, on the "?q=calendar" web page (in "Month", "Week", and "Day" views). "Medium" date format is what I have set as the default for this installation of Drupal.
I had changed the "Calendar Page" view within the "calendar" view in the Views module, to set the format for the "Content: Class date (field_class_date) - From date" field to my custom "Time-only" date format. I thought that this would propagate to all of the other views (i.e., "Month", "Week", "Day"). But, it doesn't.
I finally realized that I had to override that field's format in each of the "Month", "Week", and "Day" attachment views. Once I did that, my Events only show the time portion, as I wanted.
Thank you again for sharing this information - I really appreciate it. As someone who is new to web development, CMS, and Drupal (though I have a lot of other development and admin experience), I am finding that Drupal, PHP, and CSS are a powerful set of tools. I also find that the Drupal community is very helpful. :)
Pete
Wonderful community
Thanks everybody!!!