Comments (5)
more info, this is how i call the script:
$(function () {
var staff = $(".staffList").val();
var myStaffListArr = myStaffList.split(',');
var options = {
type : 'bar',
startDatetime : '2019-01-21 0:00',
scale : 'day',
headline : {
display : true,
title : '',
range : true,
locale : 'en-US',
format : { timeZone: 'Asia/Kuala_Lumpur', hour12: false, year: 'numeric', month: 'numeric', day: 'numeric' }
},
footer : {
display : false,
range : true,
locale : 'en-US',
format : { timeZone: 'Asia/Kuala_Lumpur', hour12: false, year: 'numeric', month: 'numeric', day: 'numeric' }
},
sidebar : {
sticky : true,
list : staff,
},
ruler : {
top : {
lines : [ 'year', 'month', 'day', 'weekday' ],
height : 26,
fontSize : 13,
color : '#869e86',
background : '#FFF',
locale : 'en-US',
format : { timeZone: 'Asia/Kuala_Lumpur', hour12: false, decade: 'ordinal', lustrum: 'ordinal', year: 'zerofill', month: 'long', weekday: 'short', hour: 'numeric', minute: 'numeric' },
}
},
eventMeta : {
display : false,
scale : 'days',
},
zoom : false,
};
$('#my-timeline').Timeline( options );
});
and the html look like following:
<div id="my-timeline">
<ul class="timeline-events">
<li data-timeline-node='{"row":"1","start":"2019-02-01 00:00","end":"2019-02-01 00:00","bgColor":"#ffc107","color":"#FFFFFF","label":"Annual Leave"}'>DAVID MORIS</li>
<li data-timeline-node='{"row":"2","start":"2019-02-04 00:00","end":"2019-02-04 00:00","bgColor":"#ffc107","color":"#FFFFFF","label":"Annual Leave"}'>Joss Melon</li>
<li data-timeline-node='{"row":"3","start":"2019-02-04 00:00","end":"2019-02-08 00:00","bgColor":"#ffc107","color":"#FFFFFF","label":"Annual Leave"}'>Angeline Tan</li
</ul>
</div>
from the data above, only 3 will show the timeline from 2019-02-04 to 2019-02-08, the other not showing because the start date and end date are same. How to make it show?
thanks
from jquery.timeline.
after debug, i able to see both 1 day date and non 1 day date are able to go in into:
if ( params.x + params.width <= _props.fullwidth ) {
// The event end datetime is less than before the timeline end datetime (regular event) (:> イベント終点がタイムラインの終点以下(通常イベント)
// OK
console.log(params.eventId," 3. we are inside params.x + params.width <= _props.fullwidth params.x: ",params.x," | params.width : ",params.width,"| _props.fullwidth :",_props.fullwidth);
}
the only different is the 1 day date has
params.width : " 0 "
other has value with it..
from jquery.timeline.
Hi, sorry for my late reply.
In the "bar" type timeline, the events where the time difference between the start date and end date of the event is not greater than 0 are invalid events and are not displayed. Also if the event where the time difference is greater than 0 and the width of the event block on the timeline container is not greater than 1px will be invalid too.
To avoid this feature, you should modify the source of the _registerEventData()
method as follows.
_registerEventData( event_element, params ) {
let _opts = this._config,
_props = this._instanceProps,
new_event = {
...EventParams,
...{
uid : this.generateUniqueID(),
label : $(event_element).html()
}
},
_relation = {},
_x, _w, _c //, _pointSize
if ( params.hasOwnProperty( 'start' ) && ! this.is_empty( params.start ) ) {
_x = this._getCoordinateX( params.start )
new_event.x = this.numRound( _x, 2 )
if ( params.hasOwnProperty( 'end' ) && ! this.is_empty( params.end ) ) {
_x = this._getCoordinateX( params.end )
_w = _x - new_event.x
if ( _opts.type === 'bar' ) { // <= add this
_w = _w < 1 ? 1 : _w
}
new_event.width = this.numRound( _w, 2 )
...(The rest is omitted.)
Also, I'm going to add the "mixed" in the type of timeline at the next release. In the "mixed" type, we will be able to use already settable types of the "bar" and "point" together. Therefore, the "point" type events are outputted that set the start date only, and the "bar" type events that have an interval, together.
Thank you,
from jquery.timeline.
Arigatou gozaimasu : ) thank you sir. now working great.
i also added following:
if ( _opts.type === 'bar' ) { // <= add this
_w = _w < 1 ? 20 : _w
}
if ( _opts.type === 'bar') { // <= fix the bar size missing 20px on the end.
_w = _w < 21 ? 20 : (_w+20)
}
from jquery.timeline.
This issue has already been resolved.
from jquery.timeline.
Related Issues (20)
- Vertical Timeline? HOT 1
- use of git version breaks example HOT 1
- Are dynamic row heights possible? My events shall have different heights and the row shall adapt HOT 1
- Months in Spanish are lowercase, also wrong ordinal translation. HOT 1
- Fixed height and vertical scroll bar HOT 1
- Alignment crash on firefox HOT 1
- hoverEvent HOT 1
- eventMeta formatting HOT 1
- Getting error Cannot read properties of undefined (reading 'fn') HOT 3
- Ignore dates without data
- Possibility to make header ruler sticky HOT 2
- add event issue
- import with requireJS
- Events being copied after reload HOT 1
- Overlapping Events should display on different lines but in the same row
- Conflict with Vuejs
- test.js:3 Uncaught TypeError: $(...).timeline is not a function HOT 5
- Remote events data HOT 2
- event drag and drop feature HOT 1
- Scale half-hour
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jquery.timeline.