-
Notifications
You must be signed in to change notification settings - Fork 353
FormattingUtilities support for parsing dates in RFC 850 long year format #196
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great @TKharaishvili. Just needs another entry in the following test data:
AspNetWebStack/test/System.Net.Http.Formatting.Test/FormattingUtilitiesTests.cs
Lines 86 to 114 in 7493846
public static TheoryDataSet<string, DateTimeOffset> ValidDateValues | |
{ | |
get | |
{ | |
return new TheoryDataSet<string, DateTimeOffset> | |
{ | |
// RFC1123 date/time value | |
{ "Sun, 06 Nov 1994 08:49:37 GMT", new DateTimeOffset(1994, 11, 6, 8, 49, 37, TimeSpan.Zero) }, | |
{ "Sun, 06 Nov 1994 08:49:37", new DateTimeOffset(1994, 11, 6, 8, 49, 37, TimeSpan.Zero) }, | |
{ "6 Nov 1994 8:49:37 GMT", new DateTimeOffset(1994, 11, 6, 8, 49, 37, TimeSpan.Zero) }, | |
{ "6 Nov 1994 8:49:37", new DateTimeOffset(1994, 11, 6, 8, 49, 37, TimeSpan.Zero) }, | |
{ "Sun, 06 Nov 94 08:49:37", new DateTimeOffset(1994, 11, 6, 8, 49, 37, TimeSpan.Zero) }, | |
{ "6 Nov 94 8:49:37", new DateTimeOffset(1994, 11, 6, 8, 49, 37, TimeSpan.Zero) }, | |
// RFC850 date/time value | |
{ "Sunday, 06-Nov-94 08:49:37 GMT", new DateTimeOffset(1994, 11, 6, 8, 49, 37, TimeSpan.Zero) }, | |
{ "Sunday, 6-Nov-94 8:49:37", new DateTimeOffset(1994, 11, 6, 8, 49, 37, TimeSpan.Zero) }, | |
// ANSI C's asctime() format | |
{ "Sun Nov 06 08:49:37 1994", new DateTimeOffset(1994, 11, 6, 8, 49, 37, TimeSpan.Zero) }, | |
{ "Sun Nov 6 8:49:37 1994", new DateTimeOffset(1994, 11, 6, 8, 49, 37, TimeSpan.Zero) }, | |
// RFC5322 date/time | |
{ "Sat, 08 Nov 1997 09:55:06 -0600", new DateTimeOffset(1997, 11, 8, 9, 55, 6, new TimeSpan(-6, 0, 0)) }, | |
{ "8 Nov 1997 9:55:6", new DateTimeOffset(1997, 11, 8, 9, 55, 6, TimeSpan.Zero) }, | |
{ "Sat, 8 Nov 1997 9:55:6 +0200", new DateTimeOffset(1997, 11, 8, 9, 55, 6, new TimeSpan(2, 0, 0)) }, | |
}; | |
} | |
} |
@dougbu added the change you requested. Thanks for the guidance. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks very much @TKharaishvili. I'll get this in tomorrow…
Addresses #187