Bug related to current culture

Feb 13, 2012 at 8:28 PM

My site is running in the nl-NL culture, where dates are formatted like: 31-01-2012 (dd-MM-yyyy).

However, the Date picker populates the input field with a date format like: 01/31/2012 (MM/dd/yyyy).

When saving the change, the DateTimeFieldDriver will not be able to parse the en-GB format, as it expects a nl-NL format.

Mar 14, 2012 at 9:41 PM

Can I add my name to this bug:

Ausrtalia uses same date format dd/mm/yyy and am getting errors continually having to manually change the mm/dd/yyyy format returned from the editor

Coordinator
Mar 14, 2012 at 9:44 PM

This is fixed in current 1.x branch.

Mar 14, 2012 at 10:13 PM

Can I ask ...

I have a viewmodel with a field

        [Display(Name="Date of Birth"),UIHint("Date")]
    public DateTime DOB { get; set; }

then

  • @Html.EditorFor(m=>m.DOB)
  • but I'm not getting the datepicker? 

     

    
    Coordinator
    Mar 14, 2012 at 10:15 PM

    Doesn't work like this ... this is pure MVC and technically it could be possible but you will have to do it by yourself.

    Mar 14, 2012 at 10:23 PM
    Edited Mar 14, 2012 at 10:41 PM

    Well then cant I create a edit template and call the datepicker?

     Ive been currently using the telerik control since the date format issues

    @using Telerik.Web.Mvc.UI
    @model DateTime?
    
    @(Html.Telerik().DatePickerFor(m => m)
          .HtmlAttributes(new { id = ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty) + "_wrapper" })
          .Name("DatePicker")
    )
    
    Apr 20, 2012 at 5:35 AM

    I have the same issue. I am using version 1.0. Has it been fixed in that one?

    Apr 20, 2012 at 6:14 AM

    i beleive its only the 1.4 1.x branch?

    Apr 20, 2012 at 6:25 AM

    oh right. I am on Orchard 1.3 using Datetime field version 1.0. So, not fixed in this one I am guessing...

    Any workaround?