Skip to content

Add Duration.JulianYear #978

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Nov 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions Common/UnitDefinitions/Duration.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,21 @@
"Abbreviations": [ "сек", "с" ]
}
]
},
{
"SingularName": "JulianYear",
"PluralName": "JulianYears",
"BaseUnits": {
"T": "JulianYear"
},
"FromUnitToBaseFunc": "x*365.25*24*3600",
"FromBaseToUnitFunc": "x/(365.25*24*3600)",
"Localization": [
{
"Culture": "en-US",
"Abbreviations": [ "jyr", "jyear", "jyears" ]
}
]
}
]
}
13 changes: 13 additions & 0 deletions UnitsNet.NanoFramework/GeneratedCode/Quantities/Duration.g.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions UnitsNet.NumberExtensions/UnitsNet.NumberExtensions.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<!-- NuGet properties -->
<PropertyGroup>
<PackageId>UnitsNet.NumberExtensions</PackageId>
Expand Down Expand Up @@ -43,7 +43,7 @@

<!-- Files to include in nuget package -->
<ItemGroup>
<None Include="../Docs/Images/logo-32.png" Pack="true" PackagePath="/"/>
<None Include="../Docs/Images/logo-32.png" Pack="true" PackagePath="/" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<!-- NuGet properties -->
<PropertyGroup>
<PackageId>UnitsNet.Serialization.JsonNet</PackageId>
Expand Down Expand Up @@ -54,7 +54,7 @@

<!-- Files to include in nuget package -->
<ItemGroup>
<None Include="../Docs/Images/logo-32.png" Pack="true" PackagePath="/"/>
<None Include="../Docs/Images/logo-32.png" Pack="true" PackagePath="/" />
</ItemGroup>

</Project>
2 changes: 2 additions & 0 deletions UnitsNet.Tests/CustomCode/DurationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ public class DurationTests : DurationTestsBase

protected override double Years365InOneSecond => 3.170979198376458e-8;

protected override double JulianYearsInOneSecond => 3.16880878140289e-08;

[Fact]
public static void ToTimeSpanShouldThrowExceptionOnValuesLargerThanTimeSpanMax()
{
Expand Down
63 changes: 39 additions & 24 deletions UnitsNet.Tests/GeneratedCode/TestsBase/DurationTestsBase.g.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading