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 times to "all day"
Pages: [1]   Go Down
Print
Author Topic: adding times to "all day"  (Read 320 times)
0 Members and 1 Guest are viewing this topic.
elbert
New Member
*

Karma: 0
Offline Offline

Posts: 1


« on: March 01, 2005, 09:32:00 PM »

Hi-

I would like to associate start and end times with events selected as "all day" when adding an event.  That is, when a user selects "all day", I want it to mean and show on the calendar as 8am to 5 pm.

It appears to me that event scheduling is handled in "Event.inc".   In there is a subroutine, sub scheduleEvent which appears to be the place to modify.

Can anyone tell me specifically how I modify that subroutine to associate my fixed times.  Will the date be picked up?

Or if I am off base and there is somewhere else to do this, I would appreciate being pointed in the right direction.

Thank you very much,
David

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 04, 2005, 04:42:00 PM »

** Can anyone tell me specifically how I modify that subroutine to associate my fixed times. **

You mean tell you exactly the code to use?

Not me but it looks like the event times are handled here:

code:
   # If coming in using 12-hr format, switch to 24-hour internally
   if (($schedule->{'start_time_ampm'} eq "am") && ($schedule->{'start_time_hh'} == 12)) {
      $schedule->{'start_time_hh'} = 0;
      }
   elsif (($schedule->{'start_time_ampm'} eq "pm") && ($schedule->{'start_time_hh'} < 12)) {
      $schedule->{'start_time_hh'} += 12;
      }
   if (($schedule->{'end_time_ampm'} eq "am") && ($schedule->{'end_time_hh'}== 12)) {
      $schedule->{'end_time_hh'} = 0;
      }
   elsif (($schedule->{'end_time_ampm'} eq "pm") && ($schedule->{'end_time_hh'} < 12)) {
      $schedule->{'end_time_hh'} += 12;
      }
   


You'd likely have to design a conditional to fill those values manually if an all day event was posted and then also change the value of the $schedule->{'all_day'} variable 0 (zero).

Some pseudo code which could go after the code snippet above might look something like:

if ( $schedule->{'all_day'} )
~ set the times here ~
$schedule->{'start_time_hh'} = 9;
$schedule->{'end_time_hh'} = 17;
~ set "all day" to 0 ~
$schedule->{'all_day'} = 0
end if

You'd probably have to do something with the minutes as well:

$schedule->{'start_time_mm'}
$schedule->{'end_time_mm'}

JFYI

Dan O.

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

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