Core/Calendar: Improve calendar timezone handling
Port From (https://github.com/TrinityCore/TrinityCore/commit/5600316c9f69d2afda82ae0e632715b420dfd402)
This commit is contained in:
@@ -121,6 +121,8 @@ namespace Game
|
||||
{
|
||||
ObjectGuid guid = GetPlayer().GetGUID();
|
||||
|
||||
calendarAddEvent.EventInfo.Time = Time.LocalTimeToUTCTime(calendarAddEvent.EventInfo.Time);
|
||||
|
||||
// prevent events in the past
|
||||
// To Do: properly handle timezones and remove the "- time_t(86400L)" hack
|
||||
if (calendarAddEvent.EventInfo.Time < (GameTime.GetGameTime() - 86400L))
|
||||
@@ -204,6 +206,8 @@ namespace Game
|
||||
ObjectGuid guid = GetPlayer().GetGUID();
|
||||
long oldEventTime;
|
||||
|
||||
calendarUpdateEvent.EventInfo.Time = Time.LocalTimeToUTCTime(calendarUpdateEvent.EventInfo.Time);
|
||||
|
||||
// prevent events in the past
|
||||
// To Do: properly handle timezones and remove the "- time_t(86400L)" hack
|
||||
if (calendarUpdateEvent.EventInfo.Time < (GameTime.GetGameTime() - 86400L))
|
||||
@@ -240,6 +244,8 @@ namespace Game
|
||||
{
|
||||
ObjectGuid guid = GetPlayer().GetGUID();
|
||||
|
||||
calendarCopyEvent.Date = Time.LocalTimeToUTCTime(calendarCopyEvent.Date);
|
||||
|
||||
// prevent events in the past
|
||||
// To Do: properly handle timezones and remove the "- time_t(86400L)" hack
|
||||
if (calendarCopyEvent.Date < (GameTime.GetGameTime() - 86400L))
|
||||
|
||||
Reference in New Issue
Block a user