From Greg: Don't even know how to use validator.GetDateTime anymore


#1

Forwarded conversation
Subject: Don’t even know how to use validator.GetDateTime anymore

From: Greg Smalter greg.smalter@gmail.com
Date: Fri, Jan 3, 2014 at 3:46 PM
To: “William H. Gross IV” william@wgross.net, Sam Rueby samrueby@gmail.com

It’s asking for an array of valid formats. There is no comment on this at all.

Greg Smalter
585-455-6476


From: Sam Rueby samrueby@gmail.com
Date: Fri, Jan 3, 2014 at 4:36 PM
To: Greg Smalter greg.smalter@gmail.com
Cc: “William H. Gross IV” william@wgross.net

If you pass null, it’s the same as DateTime.Parse( dateAsString ).


From: Sam Rueby samrueby@gmail.com
Date: Fri, Jan 3, 2014 at 4:36 PM
To: Greg Smalter greg.smalter@gmail.com
Cc: “William H. Gross IV” william@wgross.net

Let’s put a comment on it that you can pass null, or you can pass the exact formats you want it to be parsed-as.


From: Greg Smalter greg.smalter@gmail.com
Date: Fri, Jan 23, 2015 at 9:59 AM
To: Sam Rueby samrueby@gmail.com
Cc: “William H. Gross IV” william@wgross.net

More on this - it forces you to pass in min and max dates, but then does not publicly provide the useful Sql min and max date time constants.

Greg Smalter
585-455-6476

On Fri, Jan 3, 2014 at 4:36 PM, Sam Rueby samrueby@gmail.com wrote:
Let’s put a comment on it that you can pass null, or you can pass the exact formats you want it to be parsed-as.

On Fri, Jan 3, 2014 at 4:36 PM, Sam Rueby samrueby@gmail.com wrote:
If you pass null, it’s the same as DateTime.Parse( dateAsString ).

On Fri, Jan 3, 2014 at 3:46 PM, Greg Smalter greg.smalter@gmail.com wrote:
It’s asking for an array of valid formats. There is no comment on this at all.

Greg Smalter
585-455-6476


#2

@samrueby, I agree with adding the documentation on the formats parameter.

@greg_smalter, if you want to limit the value to the SQL Server SmallDateTime range, just use GetSqlSmallDateTime instead. And if you’re talking about DateTime instead of SmallDateTime, we don’t currently have those limits stored anywhere. I agree with adding them (and adding a new method) if you’d like.