-
Notifications
You must be signed in to change notification settings - Fork 52
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
TimeWindow in Config - can't configure #32
Comments
you can find an example of usage at |
can you use directly timeWindow: { ? |
Hello @delhoume ! I tried to use this example (https://github.com/IBM/gantt-chart/blob/60cca5558c20ea818dc512e0d60ea65c7adb6b5f/packages/ibm-gantt-chart-docs/src/docs/data_time_window.md), but I don't have sure about a date format declaration in my object. I declared an object like this example: var timewindows = { But doesn't worked. Using value directing in configuration, like bellow, doesn't work too. timeWindow: { |
The code that shows an error is in
and is called at
I do not know exactly why this fails and what should be the correct arguments, it seems that url should contain a path to a json object that should contains keys described in the start and end parts of the timeWindow object, so maybe defining an external file as shown in the doc works. |
it seems that url is mandatory and it must be an external file, or you will have an error. |
I found that fetchers can have inline data (not urls), see timeWindow : { with timewindows beeing an array or a fonction returning an array. |
Unfortunately I also tried differents ways... Using a separated json file or using a array like that bellow. Also tried different types of date (linux epoch, ust etc) and changing the property names of start and end...
The same error is showed:
|
your is not an array, can you try const timeWindows = [ { as described in doc for fetchers with the resources field ? |
Maybe also the values need to be strings const timeWindows = [ { |
I tried using these ways but got same error |
I am running out of ideas, I will try to trace source code to see what happens |
I do not see why timeWindow fetcher is different from other fetchers (activities or resources)... |
Thank you very much @delhoume I really don't know why TimeWindow parameter in config do not work correctly here. Now, I edited other path code in JS to force time window and it worked for me. If you or someone else find where is my problem using timeWindow parameter in config, let me know! Thank you for your time and help! |
You're welcome |
For future users trying to solve this problem, this was the solution that worked for me: const config = {
data: {
...,
timeWindow: () => {
return new Promise((resolve, _) => {
resolve({
start: <your start date here>,
end: <your end date here>,
});
});
},
},
};
This line seems to suggest the timeWindowFetcher expects a Promise and does not take any other forms of input into consideration.
Hope that helps! |
Thank you for your solution ! |
I am struggling with No time window defined - doesn't help but i am quiet new at this
|
It seems there is a solution two posts above |
I have tried what is recommended not sure what I am missing |
I have this error now Loading error : Invalid start "NaN" |
please show your timeWindow() code |
|
this is the error I am getting |
what is your makeDate function ? |
Hello,
I am trying to configure TimeWindow property to my Gantt, but I can't get this working...
Using this code:
`
var timewindows = {
windowStart: 1598979874000,
windowEnd: 1662051874000,
};
I tried differents formats of date in object, but the same error.
Could anyone help me? Thanks.
Error:
Error initializing the Gantt : Could not configure data for timeWindow. Probably a configuration issue with key(s) start,end checkFetcher@http://localhost:50863/Scripts/ibm-gantt-chart-jquery.js:4074:17 setConfiguration@http://localhost:50863/Scripts/ibm-gantt-chart-jquery.js:4201:21 GanttModel@http://localhost:50863/Scripts/ibm-gantt-chart-jquery.js:750:14 GanttModel@http://localhost:50863/Scripts/ibm-gantt-chart-jquery.js:4060:125 createModel@http://localhost:50863/Scripts/ibm-gantt-chart-jquery.js:7946:19 setConfiguration@http://localhost:50863/Scripts/ibm-gantt-chart-jquery.js:7914:27 GanttPanel/_this.initPromise<@http://localhost:50863/Scripts/ibm-gantt-chart-jquery.js:7716:20
The text was updated successfully, but these errors were encountered: