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

[eluser]darky84[/eluser]
you are the man Big Grin Big Grin
thanks alot,

can i ask you if anything did work with me?
#12

[eluser]Spir[/eluser]
[quote author="darky84" date="1366810388"]you are the man Big Grin Big Grin
thanks alot,

can i ask you if anything did work with me?[/quote]Sure. But I'm not using it anymore and it should work out of the box.
#13

[eluser]darky84[/eluser]
yeah it works fine but the following happened with me :
this is the output:
i set the start_day = saturday
-----------------------------------------------------------------------------------------------------------------------------------
before
Saturday 27 April Sunday 28 April Monday 29 April Tuesday 30 April Wednesday 01 May Thursday 02 May Friday 03 May
after
-----------------------------------------------------------------------------------------------------------------------------------


it starts from the next week not this current week which it has to start from Saturday 20 April

also
the links before and after not working at all
#14

[eluser]Spir[/eluser]
[quote author="darky84" date="1366811406"]yeah it works fine but the following happened with me :
this is the output:
i set the start_day = saturday
-----------------------------------------------------------------------------------------------------------------------------------
before
Saturday 27 April Sunday 28 April Monday 29 April Tuesday 30 April Wednesday 01 May Thursday 02 May Friday 03 May
after
-----------------------------------------------------------------------------------------------------------------------------------


it starts from the next week not this current week which it has to start from Saturday 20 April

also
the links before and after not working at all
[/quote]Can you show the code you setup?
#15

[eluser]darky84[/eluser]
the calendar_week.php its the same you gave me
and here is the controller

Code:
<?php

class Week extends CI_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'    => 'saturday',
                        '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);
      
    }
}
?&gt;
#16

[eluser]Spir[/eluser]
You have to also set url config so controller method index will be called. Otherwise you get a 404.
There must be a bug about the start date in set_week method of the lib I guess that's why it start with next week.
I have no time right now. I'll try to find out a bit later if I can.
#17

[eluser]darky84[/eluser]
ok man, many thanks for your effort




Theme © iAndrew 2016 - Forum software by © MyBB