Welcome Guest, Not a member yet? Register   Sign In
Generating week
#7

[eluser]Spir[/eluser]
Ok so I have build something using your function, but I have a small issue. Let me show you what I have :

In my controller :

Code:
class week extends Controller {

    function index($year='', $month='', $day=''){
        if ($year==null) {
            $year = date('Y');
        }
        
        if ($month==null) {
            $month = date('m');
        }
        
        if ($day==null) {
            $day = date('d');        
        }    

        $calendarPreference = array (
                        'start_day'    => 'monday',
                        'month_type'   => 'long',
                        'day_type'     => 'long',
                        'date'     => date(mktime(0, 0, 0, $month, $day, $year))
                    );        
        $this->load->library('calendar_week', $calendarPreference);

        // I need to feed my calndar week with some data
        // for the example data are empty
        $weeks = $this->calendar_week->get_week();
        $arr_Data = Array();
        for ($i=0;$i<count($weeks);$i++){
            $arr_Data[$weeks[$i]] = '';
        }

        $content['data'] = $arr_Data;      
        $this->load->view('show_week', $content);
        ...
    }
}

In my view I only have this :
Code:
&lt;?php echo $this->calendar_week->generate($data); ?&gt;

And here is my lib called calendar_week (it use the language file of the Calendar) : http://rafb.net/p/HzRvNf45.html
It works fine. The only issue is when I press previous week, I shows the same week.I think the issue comes from your function ''set_week()'' that does not set the propper week because I send the sunday of the previous week.


Messages In This Thread
Generating week - by El Forum - 11-30-2008, 06:03 PM
Generating week - by El Forum - 12-01-2008, 12:53 AM
Generating week - by El Forum - 12-01-2008, 01:38 AM
Generating week - by El Forum - 01-28-2009, 05:09 AM
Generating week - by El Forum - 01-28-2009, 06:23 AM
Generating week - by El Forum - 01-28-2009, 10:41 AM
Generating week - by El Forum - 01-30-2009, 03:47 AM
Generating week - by El Forum - 01-30-2009, 03:49 AM
Generating week - by El Forum - 04-24-2013, 06:09 AM
Generating week - by El Forum - 04-24-2013, 06:20 AM
Generating week - by El Forum - 04-24-2013, 06:33 AM
Generating week - by El Forum - 04-24-2013, 06:36 AM
Generating week - by El Forum - 04-24-2013, 06:50 AM
Generating week - by El Forum - 04-24-2013, 07:03 AM
Generating week - by El Forum - 04-24-2013, 07:05 AM
Generating week - by El Forum - 04-24-2013, 07:09 AM
Generating week - by El Forum - 04-24-2013, 07:11 AM



Theme © iAndrew 2016 - Forum software by © MyBB