Date Format on Date Range

Jun 3, 2012 at 1:39 PM


is there a way of changing the date format to UK in the dat range field?

It is currently being used as MM/DD/YYYY rather than DD/MM/YYYY

All other dates within Sharepoint are in UK format so this effects the use of this filter.

Jun 3, 2012 at 4:23 PM

I found making the following change to controlmanager.cs sorted the issue out:

 

  private static void PrepareContainerForDateRange(Control container, ListFilterField field, SPField spField)
        {
            var dtRange = new Control();

            var dtl = new DateTimeControl { DateOnly = true };
            var dtr = new DateTimeControl { DateOnly = true };
           
            //Paul Gallagher change to fix locale
            dtl.LocaleId = Convert.ToInt32(SPContext.Current.RegionalSettings.LocaleId);
            dtr.LocaleId = Convert.ToInt32(SPContext.Current.RegionalSettings.LocaleId);

            dtRange.Controls.Add(new LiteralControl(string.Format(@"<span style=""display:block;float:left;line-height: 26px; margin-right: 4px;"">{0}</span>", LocalizedString("Text_From"))));
            dtRange.Controls.Add(dtl);
            dtRange.Controls.Add(new LiteralControl(string.Format(@"<span style=""display:block;float:left;line-height: 26px; margin-right: 4px;"">{0}</span>", LocalizedString("Text_To"))));
            dtRange.Controls.Add(dtr);
            container.Controls.Add(dtRange);
        }

Coordinator
Jun 4, 2012 at 9:12 AM
Edited Jun 4, 2012 at 9:12 AM

This bug is fixed in new release