JVCL Help:TJvTFDays.AdjustEndTime

From Project JEDI Wiki
Jump to navigationJump to search
JEDI Visual Component Library Help

Search in JVCL Help

 
Search in all projects
 

Summary

Adjusts the end time of an appointment.


Pascal

 functionAdjustEndTime(ATime: TTime): TTime; dynamic;


Parameters

Parameters Description
ATime: TTime The time to adjust


Return Value

The adjusted time.


Description

This method is primarily for internal use but you may find it handy from time to time. The only thing it does is subtract one second from the time given. This is used internally to temporarily adjust the ending time of appointments so that they do not fall exactly on the beginning of one of the time blocks that is displaying in the grid.


Examples

[[JVCL_Help:TJvTFDays.Granularity|Granularity]] = 60<br/>
  Appt end time = 11:00am 

Without adjusting the end time, the grid would display the appointment in the 11:00 time block (i.e. 11:00am - 12:00pm). This is clearly incorrect and misleading. By subtracting one second from the end time of the appointment (so that it ends at 10:59:59), the grid will correctly draw the appointment as ending in the 10:00am time block.

You need to be careful when working with appointment end times. To ensure the integrity of your data, the grid does not actually change the EndTime property of an appointment by applying AdjustEndTime. An example is if you would write something like:   MyEndRow := TimeToRow(AAppt.EndTime); 
This may return an incorrect result as shown above; however, if you write: MyEndRow := TimeToRow(AdjustEndTime(AAppt.EndTime)); you can be assured that MyEndRow will accurately reflect what the grid is displaying.
In fact, if you do need to find the start and/or end rows for an appointment you should use the CalcStartEndRows method as that method applies AdjustEndTime.


See Also

TJvTFDays.CalcStartEndRows


About

Contribute to this help topic

This documentation wiki is based on the collaborative effort of Project JEDI users. Your edits are welcome in order to improve documentation quality: edit this page