CellToAbsTime

Hi Bruno,

one more questione on TPlanner.

My planner is setted as plDay, and i will set the activestart & end in Runtime, it has 6 positions in order to show the days from monday to saturday.

When i click on a cell, i try to get the day and the cell hour, but j have a problem with the date.

Now j get the date reading the position header (where j store the date 02/02/2015 and the name Monday) and j get the hour with celltoabstime.



When j call this function it return a tdatetime value, where the date is wrong and the time is correct.To be honest, the date returned is the date setted in planner.mode property, in particular in planner.mode.day, planner.mode.month and planner.mode.periodstartyear.



Here the question with the planner.mode:=plDay is possible use CellToAbsTime?

And, in order to work in rigth way with CellToAbsTime i need to reset the mode property each time i move the planner to next/prev day? (there are two example on how to use AbsTimeToCell but not for CellToAbsTime).



Sorry for this easy topic.



Thank's for your attention



Daniele

In mode plDay, the datetime returned by Planner.CellToAbsTime() consists of:


date = planner.Mode.Date (day + month + year) + column
time = cell start & end time

So, if Planner.Mode.Date is today (Feb 5, 2015), clicking a 3rd column cell will return as date Feb 7, 2015 + time of the cell.
Either you can take this date part in account or you can truncate to only keep the time. If you want to use the date always and want to handle prev/next buttons, make sure to adapt Planner.Mode.Date from the OnPlannerPrev/OnPlannerNext events.

Hi Bruno,

thank's for your reply.

My question was just for information......

Now i get the hour by click on cell and the get the date by position caption.



Thank's again for your help.



ciao



Daniele