Skip to content
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

visibleDate works incorrect if startDate is not provided #3382

Closed
chuckn0rris opened this issue Sep 8, 2021 · 1 comment
Closed

visibleDate works incorrect if startDate is not provided #3382

chuckn0rris opened this issue Sep 8, 2021 · 1 comment
Assignees
Labels
bug Something isn't working forum Issues from forum resolved Fixed but not yet released (available in the nightly builds)
Milestone

Comments

@chuckn0rris
Copy link

Forum post

To reproduce remove startDate/endDate configs and add visibleDate instead with any positioning (start, center...). It will not be working, a project will be auto positioned depends on events data set.
Try to specify visibleDate with startDate provided. All works as expected.

@chuckn0rris chuckn0rris added bug Something isn't working forum Issues from forum labels Sep 8, 2021
@matsbryntse matsbryntse self-assigned this Sep 9, 2021
@matsbryntse matsbryntse added the ready for review Issue is fixed, the pull request is being reviewed label Sep 9, 2021
@matsbryntse matsbryntse added this to the 4.2.6 milestone Sep 9, 2021
@matsbryntse matsbryntse added resolved Fixed but not yet released (available in the nightly builds) and removed ready for review Issue is fixed, the pull request is being reviewed labels Sep 10, 2021
@chuckn0rris
Copy link
Author

Code to reproduce. If you uncomment startDate, it will be working.

new Gantt({
    appendTo :  'container',

rowHeight         : 80,
height            : 200,

columns : [
    { type : 'name' }
],

features : {
    projectLines : false
},

viewPreset : {
    base      : 'weekAndDayLetter',
    tickWidth : 50
},

tasks : [
   { id : 1, name : 'Write docs 1', startDate : '2017-01-02', endDate : '2017-01-06', leaf : true, percentDone : 50, manuallyScheduled: true },
{ id : 2, name : 'Write docs 2', startDate : '2017-06-10', endDate : '2017-06-16', leaf : true, percentDone : 50, manuallyScheduled: true },
{ id : 3, name : 'Write docs 3', startDate : '2017-11-02', endDate : '2017-11-06', leaf : true, percentDone : 50, manuallyScheduled: true },
{ id : 4, name : 'Write docs 4', startDate : '2015-01-02', endDate : '2018-02-06', leaf : true, percentDone : 50, manuallyScheduled: true },
{ id : 5, name : 'Write docs 5', startDate : '2016-03-02', endDate : '2018-03-06', leaf : true, percentDone : 50, manuallyScheduled: true },
{ id : 6, name : 'Write docs 6', startDate : '2017-04-02', endDate : '2018-04-06', leaf : true, percentDone : 50, manuallyScheduled: true }
    ],

assignments : [
    { id : 1, event : 1, resource : 1 },
    { id : 2, event : 1, resource : 2 }
],
// startDate : '2016-10-10',
// endDate : '2018-04-06',
visibleDate: {
  date: new Date("2017-01-02"),
  block: "center"
},
resources : [
    { id : 1, name : 'Celia Johnsson' },
    { id : 2, name : 'Lee Brook' },
    { id : 3, name : 'Macy von Schnitzel' }
],

// Custom task contents, showing initials of the assigned resources
taskRenderer({ taskRecord, renderData }) {
    // Return some custom elements, described as DomSync config objects.
    // Please see https://bryntum.com/docs/gantt/#Core/helper/DomHelper#function-createElement-static for more information.
    return [
        {
            html  : taskRecord.name,
            style : 'margin-bottom : 0.5em'
        },
        ...taskRecord.resources.map(resource => ({
            tag   : 'span',
            style : 'display:inline-block;font-size:0.8em;padding:0.4em;background:rgba(0,0,0,0.1);border-radius:50%;margin-right:0.3em',
            html  : resource.initials
        })
        )
    ];
}

> });

@chuckn0rris chuckn0rris reopened this Sep 21, 2021
@chuckn0rris chuckn0rris removed the resolved Fixed but not yet released (available in the nightly builds) label Sep 21, 2021
@matsbryntse matsbryntse added ready for review Issue is fixed, the pull request is being reviewed resolved Fixed but not yet released (available in the nightly builds) and removed ready for review Issue is fixed, the pull request is being reviewed labels Sep 21, 2021
@matsbryntse matsbryntse modified the milestones: 4.2.6, 4.2.7 Sep 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working forum Issues from forum resolved Fixed but not yet released (available in the nightly builds)
Projects
None yet
Development

No branches or pull requests

2 participants