[CLOSED] DateField culture issue

  1. #1

    [CLOSED] DateField culture issue

    Hi... in Control Panel -> Regional and Language Options my culture is set at English (Canada) while I am guessing most people have culture set to English (United States) even I do on my home PC by default.

    Where I am running into something, is not when I pick a date (that works fine!) it is when I type a date manually.

    Try this, set your culture to English (Canada) and you'll see the Short date: 16/09/2009 like mine?

    When I type 31-01-2009 (that matches the culture DD-MM-YYYY setting) it goes to 01/07/2011 in the DateField when I tab out of the field.
  2. #2

    RE: [CLOSED] DateField culture issue

    Hi,

    May be you have incorect date format. Try to use
    Format="dd-MM-yyyy"

    or


    Format="dd\-MM\-yyyy"
  3. #3

    RE: [CLOSED] DateField culture issue

    Throw a DateField on a screen and try it with Format="dd/MM/yyyy" and it does the same.
  4. #4

    RE: [CLOSED] DateField culture issue

    Hi jsemple,

    This might be a limitation (defect?) of the client-side date parser. It's not looking at the date part order (dmy vs mdy) when parsing alternate formats.


    As a temp solution, you can work around this particular scenario by setting the AltFormat property.


    Example


    <ext:DateField ID="DateField1" runat="server" Format="dd/MM/yyyy" AltFormats="dd-MM-yyyy" />

    Hope this helps.


    Geoffrey McGill
    Founder
  5. #5

    RE: [CLOSED] DateField culture issue

    You are correct, AltFormats was exactly what I needed :)
  6. #6

    RE: [CLOSED] DateField culture issue

    I should have mentioned as well, you can add multiple AltFormats by separating each format with a pipe (|).

    Example


    AltFormats="dd-MM-yyyy|d-M-yy"

    Don't worry about adding many AltFormats... the date parser is very efficient and will zip through the formats in milliseconds.


    Hope this helps.


    Geoffrey McGill
    Founder

Similar Threads

  1. Replies: 4
    Last Post: Mar 26, 2012, 12:16 AM
  2. Replies: 6
    Last Post: Aug 29, 2011, 4:54 PM
  3. Replies: 4
    Last Post: Apr 15, 2011, 3:53 PM
  4. [CLOSED][BUG] Arrow's Culture Localization in DateField
    By SETConsulting in forum 1.x Help
    Replies: 0
    Last Post: Feb 16, 2011, 8:31 AM
  5. [CLOSED] datefield issue
    By idrissb in forum 1.x Legacy Premium Help
    Replies: 6
    Last Post: Oct 23, 2009, 12:31 PM

Posting Permissions