Fix culture-sensitive parsing, log swallowing and closure capture
- DateTimeTypeConverter parses with the invariant culture instead of the ambient one (NordPool timestamps arrive as ISO-8601) - Shower last-shower-time state is formatted with the invariant culture - PresenceServiceTests no longer captures the loop variable in a Moq setup - CheapestIntervalsFinderTests compare prices with a tolerance instead of floating-point equality - MqttRecreateApp logs the unit_of_measurement read failure instead of silently swallowing every exception - LightMonitorOptions moves to LightMonitor.Models so the namespace matches the project and file location
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using AutoMapper;
|
||||
using System.Globalization;
|
||||
using AutoMapper;
|
||||
|
||||
namespace Mappings.Converters;
|
||||
|
||||
@@ -6,6 +7,6 @@ public class DateTimeTypeConverter : ITypeConverter<string, DateTime>
|
||||
{
|
||||
public DateTime Convert(string source, DateTime destination, ResolutionContext context)
|
||||
{
|
||||
return System.Convert.ToDateTime(source);
|
||||
return DateTime.Parse(source, CultureInfo.InvariantCulture);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user