Thursday 15 January 2015

c# - Converting DateTimeFormatInfo.ShortDatePattern to Regex -


I have a code which is full of BaseValidator which is spread across the entire code I feed in a regular expression string which is then used for server-side and client-side validation. When used for the date fields, this string currently uses the same format in all cultures, but I would like to use the short date pattern found in the thread. CurrentThread.CurrentCulture.DateTimeFormat.ShortDatePattern . Is there a built-in date pattern to change in a regular expression? Most other answers on the stack overflow are asked to use the DateTime.TryParseExact , but it would affect me if this client would work for side verification.

Yes, we can use any type of datetime picker, but the product owner will not accept any time soon.


No comments:

Post a Comment