Compare Validator Date Format

Discussion in 'Software' started by Anjut, Sep 19, 2009.

  1. Anjut

    Anjut

    Joined:
    Sep 18, 2009
    Messages:
    6
    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
    Last edited: Sep 19, 2009
    Anjut, Sep 19, 2009
    #1
    1. Advertising

  2. Anjut

    Anjut

    Joined:
    Sep 18, 2009
    Messages:
    6
    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.CurrentCulture = ci;
    System.Threading.Thread.CurrentThread.CurrentUICulture = ci;
    }
    Now it works perfectly fine
    Anjut, Oct 26, 2009
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. jacksu
    Replies:
    2
    Views:
    402
    jacksu
    Feb 20, 2004
  2. jhigbee@nyx.net

    Set folder date to date of newest file in the folder?

    jhigbee@nyx.net, Aug 16, 2005, in forum: Computer Support
    Replies:
    4
    Views:
    3,124
  3. Alex Hunsley

    software to set file modified date to exif photo taken date?

    Alex Hunsley, May 20, 2004, in forum: Digital Photography
    Replies:
    2
    Views:
    8,988
    David J Taylor
    May 20, 2004
  4. T. Daniels

    A Unique Link Validator

    T. Daniels, Dec 7, 2003, in forum: Computer Security
    Replies:
    1
    Views:
    411
    Jim Watt
    Dec 7, 2003
  5. T. Daniels

    A Unique Link Validator

    T. Daniels, Dec 7, 2003, in forum: Computer Information
    Replies:
    0
    Views:
    364
    T. Daniels
    Dec 7, 2003
Loading...

Share This Page