Skip to content

Commit

Permalink
FV2404 is from 2024-04-03 onwards (not 2024-04-01) (#142)
Browse files Browse the repository at this point in the history
  • Loading branch information
hf-kklein authored Jan 25, 2024
1 parent 27c7410 commit 1b680d2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions EDILibrary/EdifactFormatVersion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -355,9 +355,10 @@ public class EdifactFormatVersionHelper : IEdifactFormatVersionProvider
private static readonly DateTime KeyDate2310 = new(2023, 09, 30, 22, 0, 0, DateTimeKind.Utc);

/// <summary>
/// validity date of <see cref="EdifactFormatVersion.FV2310"/>
/// validity date of <see cref="EdifactFormatVersion.FV2404"/>
/// </summary>
private static readonly DateTime KeyDate2404 = new(2024, 03, 31, 22, 0, 0, DateTimeKind.Utc);
/// <remarks>Note that this is _not_ April 1st</remarks>
private static readonly DateTime KeyDate2404 = new(2024, 04, 02, 22, 0, 0, DateTimeKind.Utc);
public EdifactFormatVersion GetFormatVersion(DateTimeOffset keydate)
{
if (keydate >= KeyDate2404)
Expand Down
3 changes: 2 additions & 1 deletion EDILibraryTests/EdifactFormatVersionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,8 @@ public void TestFV2110()
Assert.AreEqual(EdifactFormatVersion.FV2110, versionProvider.GetFormatVersion(new DateTimeOffset(2022, 9, 30, 21, 59, 59, TimeSpan.Zero)));
Assert.AreEqual(EdifactFormatVersion.FV2210, versionProvider.GetFormatVersion(new DateTimeOffset(2022, 9, 30, 22, 0, 0, TimeSpan.Zero)));
Assert.AreEqual(EdifactFormatVersion.FV2310, versionProvider.GetFormatVersion(new DateTimeOffset(2023, 9, 30, 22, 0, 0, TimeSpan.Zero)));
Assert.AreEqual(EdifactFormatVersion.FV2404, versionProvider.GetFormatVersion(new DateTimeOffset(2024, 3, 31, 22, 0, 0, TimeSpan.Zero)));
Assert.AreEqual(EdifactFormatVersion.FV2310, versionProvider.GetFormatVersion(new DateTimeOffset(2024, 3, 31, 22, 0, 0, TimeSpan.Zero)));
Assert.AreEqual(EdifactFormatVersion.FV2404, versionProvider.GetFormatVersion(new DateTimeOffset(2024, 4, 2, 22, 0, 0, TimeSpan.Zero)));
}
}
}

0 comments on commit 1b680d2

Please sign in to comment.