natecavanaugh/liferay-portal — pull request #2846 by zsagia (2014-09-30 13:54:11+00:00)
Title: [Technical-Support] LPS-50357 Validating startTime and endTime does not consider their time zone

Hi Nate,

I have a fix for LPS-50357. This issue is about time validating in layouts admin doesn't consider time-zone.
I think if we'd like to compare a date from ui (whics is generated by user's timezone) with actual date (whics is generated browser's timezone) in javascript then we should know time-zone of ui date. Without it we won't get correct result in client environment.

4c84687: I added timeZoneOffset to InputTimeTag which will contain user's timezone offset. This offset is in milliseconds and it will be a negative value if the timezone after GMT and positive if timezone before GMT. For example if timezone = "EUROPE/ATHENS" then now offset will be -10800000 because the timezone +2(-7200000) but about daylight saving time this will be +3.

e4e0b09: LPS-45667 tried to fix a parsing error but it caused a regression. If the parsing was successfully then
the parsed Date object contained hours 0 - 23 if not then hours and minutes were set from hidden inputs without considering amPm's value.

527e55e: I added 'getTimeZoneOffset' function which provides an inverted value.

c339808: TimeZoneOffset attribute is not a required value that's way I only added this value to staging tag because in other cases we don't use time value in other javascript environment.

3989589: I used timezone value to correct date comparing.

Thanks in advance,
Zsaga