diff --git a/Extensions b/Extensions index 993c1b9..e9ed863 160000 --- a/Extensions +++ b/Extensions @@ -1 +1 @@ -Subproject commit 993c1b9f0c49f2bb4e885516f55e6175641a6387 +Subproject commit e9ed8637e3df9c142136ba64b8f1e7b11e44f85c diff --git a/System.Polyfills/System/DateOnly.cs b/System.Polyfills/System/DateOnly.cs index eebf473..e84226b 100644 --- a/System.Polyfills/System/DateOnly.cs +++ b/System.Polyfills/System/DateOnly.cs @@ -43,7 +43,7 @@ readonly struct DateOnly private static int DayNumberFromDateTime(DateTime dt) => (int)((ulong)dt.Ticks / TimeSpan.TicksPerDay); - private DateTime GetEquivalentDateTime() => new DateTime(_dayNumber * TimeSpan.TicksPerDay); + private datetime GetEquivalentDateTime() => new datetime(_dayNumber * duration.TicksPerDay); private DateOnly(int dayNumber) { @@ -54,12 +54,12 @@ private DateOnly(int dayNumber) /// /// Gets the earliest possible date that can be created. /// - public static DateOnly MinValue => new DateOnly(MinDayNumber); + public static DateOnly MinValue => new (MinDayNumber); /// /// Gets the latest possible date that can be created. /// - public static DateOnly MaxValue => new DateOnly(MaxDayNumber); + public static DateOnly MaxValue => new (MaxDayNumber); /// /// Creates a new instance of the structure to the specified year, month, and day. @@ -68,7 +68,7 @@ private DateOnly(int dayNumber) /// The month (1 through 12). /// The day (1 through the number of days in ). public DateOnly(int year, int month, int day) => - _dayNumber = DayNumberFromDateTime(new DateTime(year, month, day)); + _dayNumber = DayNumberFromDateTime(new (year, month, day)); /// /// Creates a new instance of the structure to the specified year, month, and day for the specified calendar. @@ -78,7 +78,7 @@ public DateOnly(int year, int month, int day) => /// The day (1 through the number of days in ). /// The calendar that is used to interpret , , and . public DateOnly(int year, int month, int day, Calendar calendar) => - _dayNumber = DayNumberFromDateTime(new DateTime(year, month, day, calendar)); + _dayNumber = DayNumberFromDateTime(new (year, month, day, calendar)); /// /// Creates a new instance of the structure to the specified number of days. @@ -160,7 +160,7 @@ static void ThrowOutOfRange() => /// An object whose value is the sum of the date represented by this instance /// and the number of months represented by . public DateOnly AddMonths(int value) => - new DateOnly(DayNumberFromDateTime(GetEquivalentDateTime().AddMonths(value))); + new (DayNumberFromDateTime(GetEquivalentDateTime().AddMonths(value))); /// /// Adds the specified number of years to the value of this instance. @@ -169,7 +169,7 @@ public DateOnly AddMonths(int value) => /// An object whose value is the sum of the date represented by this instance /// and the number of years represented by . public DateOnly AddYears(int value) => - new DateOnly(DayNumberFromDateTime(GetEquivalentDateTime().AddYears(value))); + new (DayNumberFromDateTime(GetEquivalentDateTime().AddYears(value))); /// /// Determines whether two specified instances of are equal. diff --git a/System.Polyfills/icon.png b/System.Polyfills/icon.png new file mode 100644 index 0000000..db07a03 Binary files /dev/null and b/System.Polyfills/icon.png differ