-
-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
German translation / Show current date on init #77
Comments
Hi there,
Firstly, the format of the datetime displayed in the ruler depends on the behavior of the native JavaScript Date.prototype.toLocaleString method. Therefore, it is a specification that when the format is applied to the value of a single part of a datetime object, such as an individual hour, minute, or day, a unit might be given. console.log(new Date().toLocaleString('de'));// 24.3.2021, 19:10:31
console.log(new Date().toLocaleString('de', { hour: 'numeric' }));// 19 Uhr
console.log(new Date().toLocaleString('de', { hour: '2-digit' }));// 19 Uhr Currently, the plugin does not have an option to solve this. Therefore, to avoid this problem, we need to filter the ruler values from outside this plugin. $('#myTimeline').Timeline(tlOpts).Timeline('initialized', function(instance){
// Filter displayed rulers
$(instance).find('[data-ruler-scope="hour"]').children().each(function(){
$(this).get(0).innerHTML = '<span>' + parseInt($(this).get(0).innerText, 10) + '</span>'
})
});
By adding Or, if you want to do it by picking up a user event after the timeline is displayed, use the alignment method as shown below. <button type="button" id="to-now">To Now</button> $('#to-now').on('click', function(){
$('#myTimeline').Timeline('alignment', 'now', 'fast');
}); Please try them. Thank you, |
Unfortunately, I have not been able to reproduce the symptoms of duplicate firing of the event you reported in my environment.
Thank you, |
Hello, $('div#timeline').Timeline(tlOpts).Timeline('openEvent', function(targetEvent, viewerContents) {
}); Anothe parts are done with click. With Click is it possible to add (if not exist) edit and delete events. |
Thank you for disclosing the source. You may find the demo on the CRUD page below helpful. https://ka2.org/jqtl-v2/sample-crud.html Also for reference, the source of the above page is disclosed here. https://gist.github.com/ka215/72cfc07da6d813842b9113e898260892 Thank you, |
Hello ka215, In my timeline I implement scrollbuttons to use the alignment function.
It works fine, but it scrolls to the start and to the end of the timeline. |
Unfortunately, we can not move to any custom alignment position because an alignment method is supporting the preset values and event id number only. Therefore, we should be directly handling DOM of the timeline instance without using an alignment method. $('#timelinePrevious').on('click', function(){
customAlignment(20);
});
$('#timelineNext').on('click', function(){
customAlignment('80%');
});
function customAlignment( moveTo, speed=1000 ) {
var timelineContainer = $('#myTimeline').find('.jqtl-container'),
timelineMain = $('#myTimeline').find('.jqtl-main');
if (/%$/.test(moveTo)) {
moveTo = Math.floor(timelineMain.get(0).clientWidth * (parseInt(moveTo, 10) / 100));
} else {
moveTo = parseInt(moveTo, 10);
}
timelineContainer.animate({scrollLeft: moveTo}, speed);
} Please try it. |
Hello ka215, |
Hello,
I am using the plugin for a small project now. It's very nice piece of software.
I have small issues, but hope somebody can help me :-)
I use the hour mode for the timeline.
In german language (chrome browser 89) I get the text "11 Uhr" instead of "11" on the headline.
I set the ruler to "numeric". What can be the problem?
Second point: My timeline is very big (hours) so is it possible to jump on start to the current date?
Here are my options:
var startstop = GetMinMaxDate();
window.tlOpts = {
type: 'point',
startDatetime: getDateString(startstop[0]),
endDatetime: getDateString(startstop[1]),
scale: 'hour',
rowHeight: rowHeight,
minGridSize: minGridSize,
headline: {
display: false,
title: 'Bewässerungstabelle',
range: false,
locale: 'de',
format: {
hour12: false,
}
},
sidebar: {
list: listItems,
sticky: true
},
rows: listItems.length,
ruler: {
top: {
fontSize: 14,
height: 24,
lines: [ 'day', 'hour', 'weekday'],
format: {
hour: 'numeric',
weekday: 'long'
},
locale: "de"
},
bottom: {
display: false
}
},
hideScrollbar: false,
zoom: false,
eventData: createEvents(),
effects: {
horizontalGridStyle: "solid",
verticalGridStyle: "dotted"
},
colorScheme : {
event : {
text :'#343A40',
border :'#6C757D',
background :'#0000FF'
}
}
};
Best regards

Damian
The text was updated successfully, but these errors were encountered: