fixed template reminder times
This commit is contained in:
parent
4b7bba4424
commit
7394d120e1
3 changed files with 6 additions and 4 deletions
|
@ -18,7 +18,7 @@ namespace Lieb.Models.GuildWars2.Raid
|
|||
|
||||
public Raid() { }
|
||||
|
||||
public Raid(RaidTemplate template) : base(template)
|
||||
public Raid(RaidTemplate template) : base(template, template.TimeZone)
|
||||
{
|
||||
TimeZoneInfo timeZone = TimeZoneInfo.FindSystemTimeZoneById(template.TimeZone);
|
||||
StartTimeUTC = TimeZoneInfo.ConvertTimeToUtc(template.StartTime, timeZone);
|
||||
|
|
|
@ -61,7 +61,7 @@ namespace Lieb.Models.GuildWars2.Raid
|
|||
|
||||
public RaidBase() { }
|
||||
|
||||
public RaidBase(RaidBase template)
|
||||
public RaidBase(RaidBase template, string timeZoneString)
|
||||
{
|
||||
this.Title = template.Title;
|
||||
this.Description = template.Description;
|
||||
|
@ -84,13 +84,15 @@ namespace Lieb.Models.GuildWars2.Raid
|
|||
IsRandomSignUpRole = role.IsRandomSignUpRole
|
||||
});
|
||||
}
|
||||
|
||||
TimeZoneInfo timeZone = TimeZoneInfo.FindSystemTimeZoneById(timeZoneString);
|
||||
foreach (RaidReminder reminder in template.Reminders)
|
||||
{
|
||||
this.Reminders.Add(new RaidReminder()
|
||||
{
|
||||
DiscordServerId = reminder.DiscordServerId,
|
||||
DiscordChannelId = reminder.DiscordChannelId,
|
||||
ReminderTimeUTC = reminder.ReminderTimeUTC,
|
||||
ReminderTimeUTC = TimeZoneInfo.ConvertTimeToUtc(reminder.ReminderTimeUTC.DateTime, timeZone),
|
||||
Message = reminder.Message,
|
||||
Sent = false,
|
||||
Type = reminder.Type,
|
||||
|
|
|
@ -345,7 +345,7 @@
|
|||
}
|
||||
foreach(StaticRaidReminder reminder in _staticReminders)
|
||||
{
|
||||
reminder.ReminderTimeUTC = await TimeZoneService.GetUTCDateTime(reminder.ReminderDate.Date + reminder.ReminderTime.TimeOfDay);
|
||||
reminder.ReminderTimeUTC = reminder.ReminderDate.Date + reminder.ReminderTime.TimeOfDay;
|
||||
reminder.Sent = true;
|
||||
_template.Reminders.Add(reminder);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue