Seems to be a bug in planner.CellToTime(x,y)

Hello:


I develop a planner with TPlanner multires in day mode.

When ask planner.CellToTime(x,y) the wrong  result is planner.mode.date + y (y is a resource position not a date position)

I change function TCustomPlanner.GetCellTime(i, j: Integer): TDateTime; in line 12.238 in Planner.pas

from

    Result := Result + PosToDay(j) + ID;   //should not add j , j is a resource not a day

to

    Result := Result + PosToDay(0) + ID;


and work's fine for me in multires in day mode.

It's a bug or i use wrong multires in a day mode???

Alfonso

If Planner.Mode.PlannerType = plDay, the default assumption is that the Planner works in multi-day mode for a non DB-aware Planner which I assume you are using. If you do not use multiday but treat positions as resources, only the time part of CellToTime() makes sense and the date for the Planner is the same for each position and retrieved via Planner.Mode.Date: TDateTime.

How do I select the Planner (plDay) to use multi day or resources?



I'm struggling to make the columns (7) to have a separate date each in a week.



Ole

When you use a non DB Planner, the default assumption is multiday.

If you want to use the Planner in multiresource mode, omit the date part from start & end times.

Ok, but as a suggestion it could be a new multires property and not increase the dates on each item if the planner.selposition >0 in this mode (multires mode).

I think it should not be too complicated...

We'll consider this.