Vacation workitem generating wrongly for 1 day when created thru code
On Writing automation code to adding absence workitem( Scheduled absence workitem). If the code has start date and end date as same, It is creating absence workitem for the previous date included.
For example: if i want to create workitem for Oct 22nd then the workitem created for 21-22 which is not right.
I have added the debug line for date before passed it to the function and it shows the proper value
Code snippet of schedule work item getting created.
----
IResourcePlanningClient resourcePlanningClient = (IResourcePlanningClient)iTeamRepo.getClientLibrary(IResourcePlanningClient.class);
ContributorAbsence absence= (ContributorAbsence)IContributorAbsence.ITEM_TYPE.createItem();
absence.setSummary(type.name());
absence.setStartDate(startDate);
absence.setEndDate(endDate);
absence.setContributor(engineer);
// Debug statements of Date.
System.out.println(absence.getStartDate()+"---"+absence.getEndDate());
try {
//
resourcePlanningClient.saveAbsences(new ContributorAbsence[] { absence }, new NullProgressMonitor());
}
--
>> On the completion of code execution, We are able to see workitem for mentioned date and the previous one.
-----
Your help is much appreciated.
For example: if i want to create workitem for Oct 22nd then the workitem created for 21-22 which is not right.
I have added the debug line for date before passed it to the function and it shows the proper value
Code snippet of schedule work item getting created.
----
IResourcePlanningClient resourcePlanningClient = (IResourcePlanningClient)iTeamRepo.getClientLibrary(IResourcePlanningClient.class);
ContributorAbsence absence= (ContributorAbsence)IContributorAbsence.ITEM_TYPE.createItem();
absence.setSummary(type.name());
absence.setStartDate(startDate);
absence.setEndDate(endDate);
absence.setContributor(engineer);
// Debug statements of Date.
System.out.println(absence.getStartDate()+"---"+absence.getEndDate());
try {
//
resourcePlanningClient.saveAbsences(new ContributorAbsence[] { absence }, new NullProgressMonitor());
}
--
>> On the completion of code execution, We are able to see workitem for mentioned date and the previous one.
-----
Your help is much appreciated.