Update: Save DateTime's as UTC and parse to LocalTime at the client.

This commit is contained in:
Konstantin Hintermayer
2025-05-30 23:54:11 +02:00
parent f280e49d96
commit f63681bce5
2 changed files with 6 additions and 6 deletions

View File

@ -114,12 +114,12 @@
{ {
_name = currentEvent.Name; _name = currentEvent.Name;
_description = currentEvent.Description; _description = currentEvent.Description;
_eventDate = currentEvent.EventDate; _eventDate = currentEvent.EventDate.ToLocalTime();
_location = currentEvent.Location; _location = currentEvent.Location;
_createdby = currentEvent.CreatedBy; _createdby = currentEvent.CreatedBy;
_createdon = currentEvent.CreatedOn; _createdon = currentEvent.CreatedOn.ToLocalTime();
_modifiedby = currentEvent.ModifiedBy; _modifiedby = currentEvent.ModifiedBy;
_modifiedon = currentEvent.ModifiedOn; _modifiedon = currentEvent.ModifiedOn.ToLocalTime();
} }
if(rsvp != null) if(rsvp != null)

View File

@ -82,7 +82,7 @@
{ {
_name = EventRegistration.Name; _name = EventRegistration.Name;
_description = EventRegistration.Description; _description = EventRegistration.Description;
_eventDate = EventRegistration.EventDate; _eventDate = EventRegistration.EventDate.ToLocalTime();
_location = EventRegistration.Location; _location = EventRegistration.Location;
_createdby = EventRegistration.CreatedBy; _createdby = EventRegistration.CreatedBy;
@ -113,7 +113,7 @@
EventRegistration.ModuleId = ModuleState.ModuleId; EventRegistration.ModuleId = ModuleState.ModuleId;
EventRegistration.Name = _name; EventRegistration.Name = _name;
EventRegistration.Description = _description; EventRegistration.Description = _description;
EventRegistration.EventDate = _eventDate; EventRegistration.EventDate = _eventDate.ToUniversalTime();
EventRegistration.Location = _location; EventRegistration.Location = _location;
EventRegistration = await EventRegistrationService.AddEventAsync(EventRegistration); EventRegistration = await EventRegistrationService.AddEventAsync(EventRegistration);
await logger.LogInformation("EventRegistration Added {EventRegistration}", EventRegistration); await logger.LogInformation("EventRegistration Added {EventRegistration}", EventRegistration);
@ -123,7 +123,7 @@
Event EventRegistration = await EventRegistrationService.GetEventAsync(_id, ModuleState.ModuleId); Event EventRegistration = await EventRegistrationService.GetEventAsync(_id, ModuleState.ModuleId);
EventRegistration.Name = _name; EventRegistration.Name = _name;
EventRegistration.Description = _description; EventRegistration.Description = _description;
EventRegistration.EventDate = _eventDate; EventRegistration.EventDate = _eventDate.ToUniversalTime();
EventRegistration.Location = _location; EventRegistration.Location = _location;
await EventRegistrationService.UpdateEventAsync(EventRegistration); await EventRegistrationService.UpdateEventAsync(EventRegistration);
await logger.LogInformation("EventRegistration Updated {EventRegistration}", EventRegistration); await logger.LogInformation("EventRegistration Updated {EventRegistration}", EventRegistration);