locked
DateTime_Edit control in DD Futures and DD Preview 2 RRS feed

  • Question

  • User-330204900 posted

    When I update date field I'm getting this error see image when I insert or update if the date output doesent by chance match the local date format.

    It's there in the old DD Futures. I think it's trying to put 30/01/2009 (dd/MM/YYYY) in that put me onto it is US format (MM/dd/YYYY) this which seems to be what the calendar extender seems to output. So if you set 30th Jan 09 you get 9th of the 30th month 2009 thus the error.

    I'm supprised it's not shown up before. I'm in the UK by the way [:D]

    Or I may be being stupid [:$]

    Friday, January 9, 2009 6:49 PM

Answers

  • User-330204900 posted

    Sorry to do this again I think I have the answer myself, after doing a bit of digging it appears there are some globalization issues with the calendar extender.

    Here's the fix for it returning the wrong format: 

    protected void Page_Load(object sender, EventArgs e)
    {
        defaultCalendarExtender.Format = CultureInfo.CurrentCulture.DateTimeFormat.ShortDatePattern;
        TextBox1.ToolTip = Column.Description;
    
        SetUpValidator(RequiredFieldValidator1);
        SetUpValidator(RegularExpressionValidator1);
        SetUpValidator(DynamicValidator1);
    }
    

    The line in BOLD ITALIC is the modificationm you will also have to resolve namspace for globalization . [:D]

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, January 9, 2009 7:05 PM
  • User-1005219520 posted

    Thanks Stephen - I opened a bug on this. It will be fixed in the next version.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, January 9, 2009 7:31 PM

All replies

  • User-330204900 posted

    Sorry to do this again I think I have the answer myself, after doing a bit of digging it appears there are some globalization issues with the calendar extender.

    Here's the fix for it returning the wrong format: 

    protected void Page_Load(object sender, EventArgs e)
    {
        defaultCalendarExtender.Format = CultureInfo.CurrentCulture.DateTimeFormat.ShortDatePattern;
        TextBox1.ToolTip = Column.Description;
    
        SetUpValidator(RequiredFieldValidator1);
        SetUpValidator(RegularExpressionValidator1);
        SetUpValidator(DynamicValidator1);
    }
    

    The line in BOLD ITALIC is the modificationm you will also have to resolve namspace for globalization . [:D]

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, January 9, 2009 7:05 PM
  • User-1005219520 posted

    Thanks Stephen - I opened a bug on this. It will be fixed in the next version.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, January 9, 2009 7:31 PM