From 9ec0173a1fa00dc79143230d71d2e5bedcd57728 Mon Sep 17 00:00:00 2001 From: Dmitriy Benyuk Date: Thu, 15 Aug 2024 13:05:57 +0300 Subject: [PATCH] Issues converting dateTimeString --- src/Dynamicweb.DataIntegration.Providers.ODataProvider.csproj | 2 +- src/ODataSourceReader.cs | 2 +- src/ODataWriter.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Dynamicweb.DataIntegration.Providers.ODataProvider.csproj b/src/Dynamicweb.DataIntegration.Providers.ODataProvider.csproj index c708fdf..5c612d7 100644 --- a/src/Dynamicweb.DataIntegration.Providers.ODataProvider.csproj +++ b/src/Dynamicweb.DataIntegration.Providers.ODataProvider.csproj @@ -1,6 +1,6 @@  - 10.6.1 + 10.6.2 1.0.0.0 OData Provider The Odata Provider lets you fetch and map data from or to any OData endpoint. diff --git a/src/ODataSourceReader.cs b/src/ODataSourceReader.cs index 532cc67..3138d83 100644 --- a/src/ODataSourceReader.cs +++ b/src/ODataSourceReader.cs @@ -315,7 +315,7 @@ private string GetModeAsParameters() if (!string.IsNullOrWhiteSpace(dateTimeFilterName)) { - var theDateTime = ODataWriter.GetTheDateTimeInZeroTimeZone(lastRunDateTime.Value.ToString(CultureInfo.InvariantCulture), isEdmDate); + var theDateTime = ODataWriter.GetTheDateTimeInZeroTimeZone(lastRunDateTime.Value, isEdmDate); if (isEdmDate) { dateTimeFilterName += " ge " + theDateTime; diff --git a/src/ODataWriter.cs b/src/ODataWriter.cs index 17fbd42..6438071 100644 --- a/src/ODataWriter.cs +++ b/src/ODataWriter.cs @@ -318,7 +318,7 @@ internal string MapValuesToJSon(Dictionary row, bool isPatchRequ public static string GetTheDateTimeInZeroTimeZone(object dateTimeObject, bool isEdmDate) { - var dateTime = Converter.ToDateTime(dateTimeObject); + DateTime dateTime = (dateTimeObject is not null && dateTimeObject is DateTime) ? (DateTime)dateTimeObject : Converter.ToDateTime(dateTimeObject); DateTime dateTimeInUtc; if (SqlDateTime.MinValue.Value == dateTime || DateTime.MinValue == dateTime) {