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
Pages: [1]   Go Down
Print
Author Topic: Modding the time grids  (Read 618 times)
0 Members and 1 Guest are viewing this topic.
Audiodox
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« on: March 09, 2004, 09:34:00 PM »

Hi, I' trying to find out how to make it so,instead of a grid like this:

1:00AM
2:00AM
3:00AM
4:00AM
etc.

I'd like to make it look like this:

1:00AM
1:15AM
1:30AM
1:45AM
2:00AM
2:15AM
2:30AM
2:45AM
3:00AM
3:15AM
3:30AM
3:45AM
4:00AM
etc.

so it's in 15min increments.  Where would I start?

Thanx!

-Ry : )

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: March 10, 2004, 09:48:00 PM »

** Where would I start? **

Somewhere around the tag: <%FOREACH HOUR OF DAY%> in the default.html template file would likely be the area.

Dan O.

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

Logged
Audiodox
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« Reply #2 on: March 11, 2004, 02:31:00 AM »

Alrighty, I've got the grid itself to display time slots in 15 minute increments, but I can't for the life of me find where to make is so that you can use each slot individually.  I susspect it has something to do with this reff:

if (($_SHOW_EVENT_TIMES eq "ALL" | | $_SHOW_EVENT_TIMES eq "START") && ($EVENT->{'schedule'}->{'start_time'}))

but I don't know where it's reffering to.
http://www.digitalillumination.org/cgi-bin/kimTemple/scheduling/calendar.pl?view=Day&datestring=20040311&selected_datestring=20040311

Any ideas?

Thanx!

-Ry : )

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

Logged
Scott
Guest
« Reply #3 on: March 11, 2004, 08:30:00 AM »

I believe the events are only sorted and grouped by hour, so in your template you won't be able to get finer grained control over which block they would start in without looking at the start time of each event and grouping them into 15-minute blocks.

------------------
Scott
CalendarScript.com


Logged
Audiodox
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« Reply #4 on: March 11, 2004, 12:32:00 PM »

Yes, but where to start?

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

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: March 11, 2004, 03:19:00 PM »

** but where to start? **

if ($EVENT->{'schedule'}->{'start_time'} ...

Maybe try first printing that variable out to see what format it is in so you can make a conditional using it?

Dan O.

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

Logged
Audiodox
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« Reply #6 on: March 11, 2004, 05:21:00 PM »

How do you print a variable?

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

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: March 11, 2004, 08:52:00 PM »

** How do you print a variable? **

One way is:

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

Check the documentation on Customization : Tag Syntax

Dan O.

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

Logged
Audiodox
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« Reply #8 on: March 12, 2004, 03:14:00 AM »

Alright, here's my little interpreter:

   <%FOREACH EVENT%>
   <% $qTime = ($EVENT->{'schedule'}->{'start_time'});
   ($hqTime, $smqTime)=split(/:/, $qTime);
   ($sqTime,$mqTime)=split(/\s+/, $smqTime);
   $hTime=join(":", $hqTime,$sqTime);
   $fTime=join(" ", $hTime,$mqTime); %>
   <%/FOREACH%>

Times read out like 10:00 am, I broke it down into:

$hqTime=10
$sqTime=00
$mqTime=am/pm

then rebuilt it in to fTime=10:00 am

now I'm working on getting the 15 minute increments setup.

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

Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 230

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


WWW
« Reply #9 on: March 12, 2004, 12:24:00 PM »

** now I'm working on getting the 15 minute increments setup. **

Well since the calendar already groups events by hour, don't you only need to be concerned with the minutes?

if ($sqTime <= 15)
print it
elsif ($sqTime <= 30)
print it
elsif ($sqTime <= 45)
print it
else # (must be > 45 but less than the next hour)
print it

Just a thought.

Dan O.


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

Logged
Audiodox
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« Reply #10 on: March 12, 2004, 08:12:00 PM »

awesome, Thanx!  

I'd been trying to figure out what was wrong with my implimentation, both the :00 & :15 events kept appearing in the :15 cell. Mine was a little messier:

<% if ($sqTime ne "00") { %>
 
<% } elsif ($sqTime eq "00") { %>
#etc.

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

Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 230

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


WWW
« Reply #11 on: March 13, 2004, 01:49:00 PM »

** Mine was a little messier: **

You could even do it all in a single loop. Eg.

$counter = "00";
while ($counter <= 60)
{
if ($sqTime <= $counter)
{
print it
$counter += 15;
}
}

JFYI

Dan O.

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

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