Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Software (http://www.velocityreviews.com/forums/f6-software.html)
-   -   Compare Validator Date Format (http://www.velocityreviews.com/forums/t698766-compare-validator-date-format.html)

Anjut 09-19-2009 09:38 AM

Compare Validator Date Format
 
Hi I am using resource files for three different Gujarati English and Hindi. In my page I have used Compare Validator for comparing date(from,to) and used caledar extender. I even gave format dd/MM/yyyy in calendar extendar but sitll its not working well. The unique thing is that it works ok when I use Gujarati or Hindi resource file and not if I use English resource file. When I did not use any format then it was working properly in English and not in Hindi,Gujarati. I don't know why this is happening. Please help me with this.


Thanks in advance

Anjut 10-26-2009 10:55 AM

Hi I found the solution if any one wants it you will have to specify the date format as it takes different date formats for different cultures so i specified the date format when my culture was not auto by using following code

if (culture != "Auto")
{
System.Globalization.CultureInfo ci = new System.Globalization.CultureInfo(culture);

DateTimeFormatInfo dtfi = new DateTimeFormatInfo();
dtfi.ShortDatePattern = "MM/dd/yyyy";
ci.DateTimeFormat = dtfi;
System.Threading.Thread.CurrentThread.CurrentCultu re = ci;
System.Threading.Thread.CurrentThread.CurrentUICul ture = ci;
}
Now it works perfectly fine


All times are GMT. The time now is 12:12 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.