Skip to content

Commit

Permalink
new version
Browse files Browse the repository at this point in the history
  • Loading branch information
mattiasnordqvist committed Jul 5, 2024
1 parent 13d6593 commit 2fd86eb
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 4 deletions.
6 changes: 3 additions & 3 deletions TimeKeeping/DotNetThoughts.TimeKeeping.App/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
},
"Microsoft.NET.ILLink.Tasks": {
"type": "Direct",
"requested": "[8.0.5, )",
"resolved": "8.0.5",
"contentHash": "4ISW1Ndgz86FkIbu5rVlMqhhtojdy5rUlxC/N+9kPh9qbYcvHiCvYbHKzAPVIx9OPYIjT9trXt7JI42Y5Ukq6A=="
"requested": "[8.0.6, )",
"resolved": "8.0.6",
"contentHash": "E+lDylsTeP4ZiDmnEkiJ5wobnGaIJzFhOgZppznJCb69UZgbh6G3cfv1pnLDLLBx6JAgl0kAlnINDeT3uCuczQ=="
},
"Microsoft.NET.Sdk.WebAssembly.Pack": {
"type": "Direct",
Expand Down
12 changes: 12 additions & 0 deletions TimeKeeping/DotNetThoughts.TimeKeeping.Tests/LocalDateTimeTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,18 @@ public void TestDateConstructor()
ldt.DateTime.Should().Be(ldt2.DateTime);
}

[Fact]
public void TestDateTimeOffsetConstructor()
{
var t = new DateTimeOffset(2024, 06, 06, 0, 0, 0, TimeSpan.FromHours(2));
var d = new DateOnly(2024, 06, 06);
var tz = TimeZoneInfo.FindSystemTimeZoneById("Central European Standard Time");
var ldt = new LocalDateTime(t, tz);
var ldt2 = new LocalDateTime(d, tz);

ldt.DateTime.Should().Be(ldt2.DateTime);
}

[Fact]
public void TestUtcDateTimeOffset()
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Version>1.0.0</Version>
<Version>1.1.0</Version>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
</PropertyGroup>
Expand Down
3 changes: 3 additions & 0 deletions TimeKeeping/DotNetThoughts.TimeKeeping/LocalDateTime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ public readonly record struct LocalDateTime
public LocalDateTime(DateOnly date, TimeZoneInfo timeZoneInfo)

Check warning on line 8 in TimeKeeping/DotNetThoughts.TimeKeeping/LocalDateTime.cs

View workflow job for this annotation

GitHub Actions / create_nuget

Missing XML comment for publicly visible type or member 'LocalDateTime.LocalDateTime(DateOnly, TimeZoneInfo)'

Check warning on line 8 in TimeKeeping/DotNetThoughts.TimeKeeping/LocalDateTime.cs

View workflow job for this annotation

GitHub Actions / create_nuget

Missing XML comment for publicly visible type or member 'LocalDateTime.LocalDateTime(DateOnly, TimeZoneInfo)'
: this(date.ToDateTime(TimeOnly.MinValue), timeZoneInfo) { }

public LocalDateTime(DateTimeOffset dateTimeOffset, TimeZoneInfo timeZoneInfo)

Check warning on line 11 in TimeKeeping/DotNetThoughts.TimeKeeping/LocalDateTime.cs

View workflow job for this annotation

GitHub Actions / create_nuget

Missing XML comment for publicly visible type or member 'LocalDateTime.LocalDateTime(DateTimeOffset, TimeZoneInfo)'

Check warning on line 11 in TimeKeeping/DotNetThoughts.TimeKeeping/LocalDateTime.cs

View workflow job for this annotation

GitHub Actions / create_nuget

Missing XML comment for publicly visible type or member 'LocalDateTime.LocalDateTime(DateTimeOffset, TimeZoneInfo)'
: this(TimeZoneInfo.ConvertTime(dateTimeOffset, timeZoneInfo).DateTime, timeZoneInfo) { }

public LocalDateTime(DateTime dateTime, TimeZoneInfo timeZoneInfo)

Check warning on line 14 in TimeKeeping/DotNetThoughts.TimeKeeping/LocalDateTime.cs

View workflow job for this annotation

GitHub Actions / create_nuget

Missing XML comment for publicly visible type or member 'LocalDateTime.LocalDateTime(DateTime, TimeZoneInfo)'

Check warning on line 14 in TimeKeeping/DotNetThoughts.TimeKeeping/LocalDateTime.cs

View workflow job for this annotation

GitHub Actions / create_nuget

Missing XML comment for publicly visible type or member 'LocalDateTime.LocalDateTime(DateTime, TimeZoneInfo)'
{
if (!((dateTime.Kind == DateTimeKind.Local && timeZoneInfo == TimeZoneInfo.Local)
Expand Down

0 comments on commit 2fd86eb

Please sign in to comment.