Skip to content
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

Introduce DateOnly and TimeOnly types #50980

Merged
merged 12 commits into from
Apr 14, 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
84 changes: 57 additions & 27 deletions src/libraries/System.Private.CoreLib/src/Resources/Strings.resx
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
<!--
Microsoft ResX Schema

Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes

The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.

Example:

... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
Expand All @@ -26,36 +26,36 @@
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple

There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the

Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not

The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can

Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.

mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.

mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.

mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
Expand Down Expand Up @@ -478,6 +478,14 @@
<data name="Arg_MustBeChar" xml:space="preserve">
<value>Object must be of type Char.</value>
</data>
<data name="Arg_MustBeDateOnly" xml:space="preserve">
<value>Object must be of type DateOnly.</value>
tarekgh marked this conversation as resolved.
Show resolved Hide resolved
<comment>{Locked="DateOnly"}</comment>
</data>
<data name="Arg_MustBeTimeOnly" xml:space="preserve">
<value>Object must be of type TimeOnly.</value>
<comment>{Locked="TimeOnly"}</comment>
tarekgh marked this conversation as resolved.
Show resolved Hide resolved
</data>
<data name="Arg_MustBeDateTime" xml:space="preserve">
<value>Object must be of type DateTime.</value>
</data>
Expand Down Expand Up @@ -1123,6 +1131,10 @@
<data name="Argument_InvalidDateTimeStyles" xml:space="preserve">
<value>An undefined DateTimeStyles value is being used.</value>
</data>
<data name="Argument_InvalidDateStyles" xml:space="preserve">
<value>The only allowed values for the styles are AllowWhiteSpaces, AllowTrailingWhite, AllowLeadingWhite, and AllowInnerWhite.</value>
tarekgh marked this conversation as resolved.
Show resolved Hide resolved
<comment>{Locked="AllowWhiteSpaces, AllowTrailingWhite, AllowLeadingWhite, and AllowInnerWhite"}</comment>
</data>
<data name="Argument_InvalidDigitSubstitution" xml:space="preserve">
<value>The DigitSubstitution property must be of a valid member of the DigitShapes enumeration. Valid entries include Context, NativeNational or None.</value>
</data>
Expand Down Expand Up @@ -1651,6 +1663,9 @@
<data name="ArgumentOutOfRange_DateTimeBadTicks" xml:space="preserve">
<value>Ticks must be between DateTime.MinValue.Ticks and DateTime.MaxValue.Ticks.</value>
</data>
<data name="ArgumentOutOfRange_TimeOnlyBadTicks" xml:space="preserve">
<value>Ticks must be between 0 and and TimeOnly.MaxValue.Ticks.</value>
</data>
<data name="ArgumentOutOfRange_DateTimeBadYears" xml:space="preserve">
<value>Years value must be between +/-10000.</value>
</data>
Expand Down Expand Up @@ -1747,6 +1762,10 @@
<data name="ArgumentOutOfRange_Month" xml:space="preserve">
<value>Month must be between one and twelve.</value>
</data>
<data name="ArgumentOutOfRange_DayNumber" xml:space="preserve">
<value>Day number must be between 0 and DateOnly.MaxValue.DayNumber.</value>
<comment>{Locked="DateOnly.MaxValue.DayNumber"}</comment>
</data>
<data name="ArgumentOutOfRange_MonthParam" xml:space="preserve">
<value>The Month parameter must be in the range 1 through 12.</value>
</data>
Expand Down Expand Up @@ -2173,6 +2192,17 @@
<data name="Format_BadDateTime" xml:space="preserve">
<value>String '{0}' was not recognized as a valid DateTime.</value>
</data>
<data name="Format_BadDateOnly" xml:space="preserve">
<value>String '{0}' was not recognized as a valid DateOnly.</value>
<comment>{Locked="DateOnly"}</comment>
</data>
<data name="Format_BadTimeOnly" xml:space="preserve">
<value>String '{0}' was not recognized as a valid TimeOnly.</value>
<comment>{Locked="TimeOnly"}</comment>
</data>
<data name="Format_DateTimeOnlyContainsNoneDateParts" xml:space="preserve">
<value>String '{0}' contains parts which are not specific to the {1}.</value>
</data>
<data name="Format_BadDateTimeCalendar" xml:space="preserve">
<value>The DateTime represented by the string '{0}' is not supported in calendar '{1}'.</value>
</data>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@
<Compile Include="$(MSBuildThisFileDirectory)System\CoreLib.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\CurrentSystemTimeZone.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\DataMisalignedException.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\DateOnly.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\DateTime.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\DateTimeKind.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\DateTimeOffset.cs" />
Expand Down Expand Up @@ -1040,6 +1041,7 @@
<Compile Include="$(MSBuildThisFileDirectory)System\Threading\WaitHandleExtensions.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\ThreadStaticAttribute.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\ThrowHelper.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\TimeOnly.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\TimeoutException.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\TimeSpan.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\TimeZone.cs" />
Expand Down
Loading