Welcome, Guest. Please login or register.
Did you miss your activation email?


Login with username, password and session length

Search

 
Advanced search

8043 Posts in 1856 Topics- by 2099 Members - Latest Member: roi
Calendar Script CommunityCustomizationHacks and Mods (Moderators: scott, DanO, Marty)Adding Start Time Field as column to Search Results
Pages: [1]   Go Down
Print
Author Topic: Adding Start Time Field as column to Search Results  (Read 618 times)
0 Members and 1 Guest are viewing this topic.
edat
Guest
« on: January 17, 2003, 05:30:00 AM »

I have found out how to add other EVENT FIELDs to show up as a search result column, but how would you add the start_time field in the same format that it shows up in the grid or list?
Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 230

Please don't PM me. Post in the open forum.


WWW
« Reply #1 on: January 17, 2003, 04:13:00 PM »

** how would you add the start_time field in the same format that it shows up in the grid or list? **

The start and end times returned by the search function are 24 hour times not AM/PM type times. You'd have to do some fancy footwork to get them to display the same.

If 24 hour military time is sufficient for that display, they're easy enough to print out:

<%= $EVENT->{schedule}->{start_time} %>
<%= $EVENT->{schedule}->{end_time} %>

You'll have to modify the template code to add another table column (or whatever) to display them in and to title it.

Dan O.

------------------

Logged
edat
Guest
« Reply #2 on: January 17, 2003, 04:57:00 PM »

is the fancy footwork code already done, i just need to copy it form another page?  Or is it much more involved than that.  This is a page my customers will book looking at and having an am/pm type will make it less cofusing to them.

I only need the start time, and i dont even really need it to say amp/pm...just the time.

thanks

Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 230

Please don't PM me. Post in the open forum.


WWW
« Reply #3 on: January 17, 2003, 06:01:00 PM »

I don't know if code to do that is used elsewhere or not. You can try:

<%= &Date::formatTime($EVENT->{schedule}->{start_time}, $Config->get("time_format")); %>

I don't know if it will work or not.

Dan O.

[This message has been edited by DanO (edited January 17, 2003).]

Logged
edat
Guest
« Reply #4 on: January 17, 2003, 06:28:00 PM »

that worked flawlessly.  your awesome.
Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 230

Please don't PM me. Post in the open forum.


WWW
« Reply #5 on: January 17, 2003, 07:55:00 PM »

** that worked flawlessly  **

Glad to hear it.

Dan O.

------------------

Logged
AWSguy
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« Reply #6 on: January 31, 2003, 02:36:00 PM »

Didn't want to start a new topic because my question is similar... I have added some custom fields to my search results.  But I can't figure out how to add the end date of events that span multiple days (if the event only occurs on one day, it's fine to repeat the start date in the end date column).

What's the variable for an event's end date that I can use to display it in search results?

Thanks!

------------------

Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 230

Please don't PM me. Post in the open forum.


WWW
« Reply #7 on: January 31, 2003, 07:30:00 PM »

** What's the variable for an event's end date that I can use to display it in search results? **

End DATE? I don't think the search function returns that information. That function returns different data than the regular calendar's getEvents function does.

Maybe the previous forum message "Searching in the template with command line argumentss" will give you some ideas how to accomplish it otherwise.

Dan O.

------------------

Logged
Pages: [1]   Go Up
Print
Jump to: