sergiogonzalez/liferay-portal — pull request #437 by KocsisDaniel (2012-11-09 12:53:43+00:00)
Title: [TECH SUPPORT] LPS-30713

Hi Sergio,

in this the original issue was that scheduled publications with "from last publish date" option doesn't worked well. It happened because we saved the start-end date into the publisherRequest and we used always the same dates instead of calculating these every time before we called the publish. The fix reuse the same logic we have many places to handle this situation. The only difference is here we don't have timezone-locale information from the themedisplay. We noticed that we don't need it at all, so I removed that part everywhere to have a consistent solution.

You mentioned your concern regarding to the fire time of the trigger. The current change doesn't affect this part, because the scheduler start-end time calculated in a different method and it work well currently. The current change affects the from-to dates that we use in the PortletDataContext.isWithinDateRange method to verify the objects modify date before we export them. But date values won't change because Calendar.getTime() produces a date based on the calendar millisec value (that doesn't change when we change calendar timezone, only the offset values and specific fields like year, month, etc... change) so it represents the same time always. It means Calendar.getInstance(someexotictimezon).getTime() is the same as new Date(). But cal.get(Calendar.HOUR) will be different then the our in the date!

Please let me know your questions/concerns.

thanks,
Daniel