phpScheduleIt
May 24, 2013, 03:06:32 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: phpScheduleIt 2.4.2 has been released!
 
   Home   Help Login Register  
Pages: [1]
  Print  
Author Topic: 45 Min Increments Solution (?)  (Read 4508 times)
franky4fingers
Jr. Member
**

Karma: 1
Posts: 53


« on: May 01, 2006, 12:03:21 PM »

File: Schedule.class.php

original code:

Code:

function get_time_array() {
        global $conf;
       
        $startDay = $startingTime = $this->startDay;
        $endDay   = $endingTime   = $this->endDay;
        $interval = $this->timespan;
        $timeHash = array();
       
        // Compute the available times
        $prevTime = $startDay;
       
        if ( (($startDay % 60) != 0) && ($interval < 60) ) {
            $time = CmnFns::formatTime($startDay);
            $timeHash[$time] = intval((60-($startDay%60))/$interval);
            $prevTime += $interval*$timeHash[$time];
        }

        while ($prevTime < $endingTime) {                                    
            if ($interval < 60) {                
                $time = CmnFns::formatTime($prevTime);
                $timeHash[$time] = intval(60 / $interval);
                $prevTime += 60;        // Always increment by 1 hour
            }
            else {
                $colspan = 1;                // Colspan is always 1
                $time = CmnFns::formatTime($prevTime);
                $timeHash[$time] = $colspan;
                $prevTime += $interval;
            }                
        }
        return $timeHash;  
    }



new code:

Code:

function get_time_array() {
        global $conf;
       
        $startDay = $startingTime = $this->startDay;
        $endDay   = $endingTime   = $this->endDay;
        $interval = $this->timespan;
        $timeHash = array();
        $prevTime = $startDay;
        $colspan = 1;
while ($prevTime < $endingTime) {
                        $time = CmnFns::formatTime($prevTime);
$timeHash[$time] = $colspan;
                        $prevTime += $interval;
                }
return $timeHash;  
    }



After you substitute the code try to set your schedule parameter:
Start Time: 10:00
End Time: 19:00
Time Span: 45 min

It seems it works!


**bella ciao**
Logged
Nick
Administrator
Hero Member
*****

Karma: 15
Posts: 5419


WWW
« Reply #1 on: May 01, 2006, 01:44:13 PM »

Good idea.  That should override the forced "1 hour constraint".

Thanks!
Logged
franky4fingers
Jr. Member
**

Karma: 1
Posts: 53


« Reply #2 on: May 02, 2006, 12:51:54 PM »

Quote from: "Nick"
Good idea.  That should override the forced "1 hour constraint".

Thanks!




Thank you for your excellent work!
Keep up the good work!!

Franky
Logged
mediashock
Newbie
*

Karma: 0
Posts: 2


« Reply #3 on: March 06, 2007, 03:49:32 PM »

I tried to implement this and i get this error


Fatal error: Call to undefined method CmnFns::formattime() in F:\Program Files\xampp\xampp\htdocs\phpScheduleIt\lib\Schedule.class.php on line 391

and i dont even see the 45 min in the choices
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2006-2007, Simple Machines Valid XHTML 1.0! Valid CSS!