Loaded events don't show up.

Hi, I try to start using Scheduler (for the moment standard 4.0 but will switch for pro at some point probably). Currently I try to load some example events from the server using JSON format. To do so I call following in json:

scheduler.config.xml_date = "%Y-%m-%d %H:%i";
            scheduler.config.minicalendar = true;
            scheduler.config.prevent_cache = true;

            Layout.content_pane.attachHTMLString(
                '<div id="scheduler_here" class="dhx_cal_container" style="width:100%; height:100%;">' +
                    '<div class="dhx_cal_navline">' +
                       '<div class="dhx_cal_prev_button">&nbsp;</div>' +
                       '<div class="dhx_cal_next_button">&nbsp;</div>' +
                       '<div class="dhx_cal_today_button"></div>' +
                       '<div class="dhx_cal_date"></div>' +
                       '<div class="dhx_minical_icon" id="dhx_minical_icon" onclick="show_minical()">&nbsp;</div>' +
                       '<div class="dhx_cal_tab" name="day_tab" style="right:204px;"></div>' +
                       '<div class="dhx_cal_tab" name="week_tab" style="right:140px;"></div>' +
                       '<div class="dhx_cal_tab" name="month_tab" style="right:76px;"></div>' +
                    '</div>' +
                    '<div class="dhx_cal_header">' +
                    '</div>' +
                    '<div class="dhx_cal_data">' +
                    '</div>' +
                '</div>');
            //Layout.content_pane.attachScheduler(new Date(), "month");
            scheduler.init('scheduler_here', new Date(), "week");
            scheduler.load('/get-events', 'json');

Using console I’ve checked the response:

{"data":[{"id":1,"text":"event1","description":"test1","start_date":"12-06-2014 12:09:35","end_date":"13-06-2014 00:09:35"},{"id":1,"text":"event1","description":"test2","start_date":"13-06-2014 11:09:35","end_date":"13-06-2014 12:39:35"}]}

And I cannot see anything wrong by comparison with the sample from documentation. However the problem is that none of the events are displayed on the scheduler and I don’t know why (I generate dates in events according to current day so that they should be always displayed). Any ideas what’s wrong?

Hi,
seems like format of date strings in your JSON does not match the format specified in xml_date config
docs.dhtmlx.com/scheduler/api__s … onfig.html

I tried also with default format and scheduler.config.xml_date = “%Y-%m-%d %H:%i”; but still doesn’t work…

Hi,
in your json response dates are formatted as following:

"start_date":"13-06-2014 12:09:35"

So in your case xml_date must have following value

scheduler.config.xml_date = "%d-%m-%Y %H:%i:%s";

docs.dhtmlx.com/scheduler/settings_format.html

Huh. I didn’t notice inverted order of days, month, year… thanks.