Advertisement
Guest User

Untitled

a guest
Feb 20th, 2019
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 4.17 KB | None | 0 0
  1. <!doctype html>
  2. <head>
  3.     <meta http-equiv="Content-type" content="text/html; charset=utf-8">
  4.     <title>Days as Timeline rows</title>
  5.  
  6.     <script src='../../codebase/dhtmlxscheduler.js?v=20190111' type="text/javascript" charset="utf-8"></script>
  7.     <script src='../../codebase/ext/dhtmlxscheduler_timeline.js?v=20190111' type="text/javascript" charset="utf-8"></script>
  8.     <script src='../../codebase/ext/dhtmlxscheduler_daytimeline.js?v=20190111' type="text/javascript" charset="utf-8"></script>
  9.     <script src='../../codebase/ext/dhtmlxscheduler_limit.js?v=20190111' type="text/javascript" charset="utf-8"></script>
  10.  
  11.     <link rel='stylesheet' type='text/css' href='../../codebase/dhtmlxscheduler_material.css?v=20190111'>
  12.  
  13.     <style type="text/css" >
  14.         html, body{
  15.             margin:0;
  16.             padding:0;
  17.             height:100%;
  18.             overflow:hidden;
  19.         }
  20.  
  21.         .dhx_matrix_scell:hover {
  22.             text-decoration: underline;
  23.         }
  24.     </style>
  25.  
  26.     <script type="text/javascript" charset="utf-8">
  27.         function init() {
  28.  
  29.             scheduler.locale.labels.timeline_tab = "Timeline";
  30.             scheduler.locale.labels.section_custom="Section";
  31.             scheduler.config.details_on_create=true;
  32.             scheduler.config.details_on_dblclick=true;
  33.             scheduler.config.xml_date="%Y-%m-%d %H:%i";
  34.  
  35.             //===============
  36.             //Configuration
  37.             //===============
  38.  
  39.  
  40.             scheduler.createTimelineView({
  41.                 name:   "timeline",
  42.                 x_unit: "minute",
  43.                 x_date: "%H:%i",
  44.                 x_step: 30,
  45.                 x_size: 24,
  46.                 x_start: 16,
  47.                 render:"days",
  48.                 days:18
  49.             });
  50.  
  51.             var view_name = 'timeline';
  52.             scheduler.attachEvent("onBeforeViewChange", function(old_mode,old_date,mode,date){
  53.                 var year = date.getFullYear();
  54.                 var month= (date.getMonth() + 1);
  55.                 var d = new Date(year, month, 0);
  56.  
  57.                 scheduler.matrix[view_name].days = d.getDate();//numbers of day in month;
  58.                 return true;
  59.             });
  60.             scheduler.date['add_' + view_name] = function(date, step){
  61.                 if(step > 0){
  62.                     step = 1;
  63.                 }else if(step < 0){
  64.                     step = -1;
  65.                 }
  66.                 return scheduler.date.add(date, step, "month")
  67.             };
  68.  
  69.             scheduler.date[view_name + "_start"] = function (date) {
  70.                 var view = scheduler.matrix.timeline;
  71.                 date = scheduler.date.month_start(date);
  72.                 date = scheduler.date.add(date, view.x_step*view.x_start, view.x_unit);
  73.                 return date;
  74.             };
  75.  
  76.             scheduler.attachEvent("onYScaleClick", function (index, section, e){
  77.                 if(scheduler.getState().mode == view_name){
  78.                     scheduler.setCurrentView(new Date(section.key), "day");
  79.                 }
  80.             });
  81.            
  82.             scheduler.addMarkedTimespan({  
  83.                 start_date: new Date(2017, 7, 10),
  84.                 end_date: new Date(2019, 7, 11),
  85.  
  86.                 zones: "fullday",       // marks the entire day
  87.                 css:   "gray_section"   // the name of applied CSS class
  88.             });
  89.  
  90.    
  91.             scheduler.init('scheduler_here',new Date(2017,5,30),"timeline");
  92.             scheduler.parse([
  93.                 { "id": "2", "start_date": "2017-06-30 12:00", "end_date": "2017-06-30 14:00", "text": "Section A test"},
  94.                 { "id": "3", "start_date": "2017-07-03 10:00", "end_date": "2017-07-06 11:00", "text": "Section B test"},
  95.                 { "id": "4", "start_date": "2017-06-30 16:00", "end_date": "2017-06-30 18:00", "text": "Section C test"},
  96.                 { "id": "5", "start_date": "2017-06-30 10:00", "end_date": "2017-06-30 15:00", "text": "Section D test"},
  97.                 { "id": "6", "start_date": "2017-06-29 12:00", "end_date": "2017-06-29 14:00", "text": "day before test"},
  98.                 { "id": "7", "start_date": "2017-07-01 12:00", "end_date": "2017-07-01 14:00", "text": "day after test"}], 'json');
  99.         }
  100.     </script>
  101. </head>
  102. <body onload="init();">
  103. <div id="scheduler_here" class="dhx_cal_container" style='width:100%; height:100%;'>
  104.     <div class="dhx_cal_navline">
  105.         <div class="dhx_cal_prev_button">&nbsp;</div>
  106.         <div class="dhx_cal_next_button">&nbsp;</div>
  107.         <div class="dhx_cal_today_button"></div>
  108.         <div class="dhx_cal_date"></div>
  109.         <div class="dhx_cal_tab" name="day_tab" style="right:204px;"></div>
  110.         <div class="dhx_cal_tab" name="week_tab" style="right:140px;"></div>
  111.         <div class="dhx_cal_tab" name="timeline_tab" style="right:280px;"></div>
  112.         <div class="dhx_cal_tab" name="month_tab" style="right:76px;"></div>
  113.     </div>
  114.     <div class="dhx_cal_header">
  115.     </div>
  116.     <div class="dhx_cal_data">
  117.     </div>
  118. </div>
  119. </body>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement