Skip to content
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
46 changes: 0 additions & 46 deletions Common/GeneratedCode/Quantities/Duration.Common.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -186,12 +186,6 @@ public static BaseDimensions BaseDimensions
/// </summary>
public double Minutes => As(DurationUnit.Minute);

/// <summary>
/// Get Duration in Months.
/// </summary>
[System.Obsolete("Use Month30 instead, which makes it clear that this is an approximate unit based on 30 days per month. The duration of a month varies, but the Gregorian solar calendar has 365.2425/12 = 30.44 days on average.")]
public double Months => As(DurationUnit.Month);

/// <summary>
/// Get Duration in Months30.
/// </summary>
Expand All @@ -212,12 +206,6 @@ public static BaseDimensions BaseDimensions
/// </summary>
public double Weeks => As(DurationUnit.Week);

/// <summary>
/// Get Duration in Years.
/// </summary>
[System.Obsolete("Use Year365 instead, which makes it clear that this is an approximate unit based on 365 days per year. The duration of a year varies due to corrections such as leap years, since a Gregorian solar calendar has 365.2425 days.")]
public double Years => As(DurationUnit.Year);

/// <summary>
/// Get Duration in Years365.
/// </summary>
Expand Down Expand Up @@ -302,21 +290,6 @@ public static Duration FromMinutes(QuantityValue minutes)
return new Duration(value, DurationUnit.Minute);
}

/// <summary>
/// Get Duration from Months.
/// </summary>
[System.Obsolete("Use Month30 instead, which makes it clear that this is an approximate unit based on 30 days per month. The duration of a month varies, but the Gregorian solar calendar has 365.2425/12 = 30.44 days on average.")]
#if WINDOWS_UWP
[Windows.Foundation.Metadata.DefaultOverload]
public static Duration FromMonths(double months)
#else
public static Duration FromMonths(QuantityValue months)
#endif
{
double value = (double) months;
return new Duration(value, DurationUnit.Month);
}

/// <summary>
/// Get Duration from Months30.
/// </summary>
Expand Down Expand Up @@ -373,21 +346,6 @@ public static Duration FromWeeks(QuantityValue weeks)
return new Duration(value, DurationUnit.Week);
}

/// <summary>
/// Get Duration from Years.
/// </summary>
[System.Obsolete("Use Year365 instead, which makes it clear that this is an approximate unit based on 365 days per year. The duration of a year varies due to corrections such as leap years, since a Gregorian solar calendar has 365.2425 days.")]
#if WINDOWS_UWP
[Windows.Foundation.Metadata.DefaultOverload]
public static Duration FromYears(double years)
#else
public static Duration FromYears(QuantityValue years)
#endif
{
double value = (double) years;
return new Duration(value, DurationUnit.Year);
}

/// <summary>
/// Get Duration from Years365.
/// </summary>
Expand Down Expand Up @@ -579,12 +537,10 @@ private double AsBaseUnit()
case DurationUnit.Microsecond: return (_value) * 1e-6d;
case DurationUnit.Millisecond: return (_value) * 1e-3d;
case DurationUnit.Minute: return _value*60;
case DurationUnit.Month: return _value*30*24*3600;
case DurationUnit.Month30: return _value*30*24*3600;
case DurationUnit.Nanosecond: return (_value) * 1e-9d;
case DurationUnit.Second: return _value;
case DurationUnit.Week: return _value*7*24*3600;
case DurationUnit.Year: return _value*365*24*3600;
case DurationUnit.Year365: return _value*365*24*3600;
default:
throw new NotImplementedException($"Can not convert {Unit} to base units.");
Expand All @@ -605,12 +561,10 @@ private double AsBaseNumericType(DurationUnit unit)
case DurationUnit.Microsecond: return (baseUnitValue) / 1e-6d;
case DurationUnit.Millisecond: return (baseUnitValue) / 1e-3d;
case DurationUnit.Minute: return baseUnitValue/60;
case DurationUnit.Month: return baseUnitValue/(30*24*3600);
case DurationUnit.Month30: return baseUnitValue/(30*24*3600);
case DurationUnit.Nanosecond: return (baseUnitValue) / 1e-9d;
case DurationUnit.Second: return baseUnitValue;
case DurationUnit.Week: return baseUnitValue/(7*24*3600);
case DurationUnit.Year: return baseUnitValue/(365*24*3600);
case DurationUnit.Year365: return baseUnitValue/(365*24*3600);
default:
throw new NotImplementedException($"Can not convert {Unit} to {unit}.");
Expand Down
Loading