calendar-app
info4c
by inbev77
HTML
<script src="http://docs.dhtmlx.com/scheduler/codebase/dhtmlxscheduler.js"></script>
<script src="http://docs.dhtmlx.com/scheduler/codebase/ext/dhtmlxscheduler_timeline.js"></script>
<link rel="stylesheet" href="http://docs.dhtmlx.com/scheduler/codebase/dhtmlxscheduler.css">
<script src="http://docs.dhtmlx.com/scheduler/codebase/ext/dhtmlxscheduler_treetimeline.js"></script>
<div id="scheduler_here" class="dhx_cal_container" style='width:1200px; height:900px;'>
<div class="dhx_cal_navline">
<div class="dhx_cal_prev_button"> </div>
<div class="dhx_cal_next_button"> </div>
<div class="dhx_cal_today_button"></div>
<div class="dhx_cal_date"></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="timeline_tab" style="right:280px;"></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>
JavaScript
scheduler.locale.labels.timeline_tab = "Timeline";
scheduler.locale.labels.section_custom="Section";
scheduler.config.details_on_create=true;
scheduler.config.details_on_dblclick=true;
scheduler.config.xml_date="%Y-%m-%d %H:%i";
//===============
//Configuration
//===============
scheduler.createTimelineView({
section_autoheight: false,
name: "timeline",
x_unit: "day",//to appear the days of the month
x_date: "%j", //number of the day
x_step: 1, //to show the all days
x_size: 31, // number of days in month( max)
x_start: 0, // zero offset from a current calendar date
x_length: 31, //the number of days that goes back and forward on prev and next button
folder_dy:20,
y_unit:[
{label:"Team A", children: [
{key:2, label:"Elizabeth Taylor"},
{label:"Team B", open: false, children: [
{key:4, label:"John Williams"},
{key:5, label:"David Miller"}
]},
{key:6, label:"Linda Brown"},
{key:7, label:"George Lucas"}
]},
{key:8, label:"Kate Moss"},
{key:9, label:"Dian Fossey"}
],
y_property: "section_id",
render: "tree",
folder_events_available: false,
dy:60
});
scheduler.attachEvent("onBeforeViewChange", function(old_mode,old_date,mode,date){
var year = date.getFullYear();
var month= (date.getMonth() + 1);
var d = new Date(year, month, 0);
var days = d.getDate();//numbers of day in month
scheduler.matrix['timeline'].x_size = days;
scheduler.matrix['timeline'].x_length = days;
return true;
});
scheduler.init('scheduler_here',new Date(2014,6,1),"timeline");
scheduler.parse([
{ start_date: "2014-06-01 09:00", end_date: "2014-06-31 12:00", text:"Task A-12458", section_id:1},
{ start_date: "2014-04-07 10:00", end_date: "2014-04-07 16:00", text:"Task A-89411", section_id:1},
{ start_date: "2014-04-07 08:00", end_date: "2014-04-07 12:00", text:"Task C-32421", section2_id:3},
{ start_date: "2014-04-07 14:30", end_date:...