This project has moved. For the latest updates, please go here.

DateTimeParser ResolveDateTimeString() doesn't work with date format ddMMyyyy

May 9, 2011 at 10:03 AM

I'm using the TimePicker and have noticed, the method ResolveDateTimeString() of DataTimeParser class doesn't work with european date format ddMMyyyy.

For instance the method is called with parameter currentDate {09.05.2011 00:00:00}, the returned value will be "5.9.2011 00:00:0 AM" where the formerly day is now the month (9th) and the formerly month is day (5th).

Would be great, if this could be solved accordingly. 

Cheers

May 9, 2011 at 2:33 PM

Can you please post the exact XAML snippet for the TimePicker?

May 10, 2011 at 9:10 AM

I use it like this:

xmlns:Controls="clr-namespace:Microsoft.Windows.Controls;assembly=WPFToolkit.Extended"

<Controls:TimePicker x:Name="throughputTimeFrom" Width="100" Value="{Binding Model.ThroughputTimeFrom, Mode=TwoWay}" />

Bound to:

public DateTime? ThroughputTimeFrom    
{
      get      {        return m_throughputTimeFrom;      }
      set
      {
        m_throughputTimeFrom = value;
        NotifyPropertyChanged(ThroughputTimeFromChangeArgs);
      }
}

May 10, 2011 at 2:54 PM

Are you using a custom format?  What culture are you using?

May 11, 2011 at 9:14 AM

No, I don't use a custom format. The current cultures DisplayName is "German (Switzerland)" and name "de-CH".

May 11, 2011 at 4:20 PM

I see the issue now.  Not sure how I will fix it, but I will try.

May 11, 2011 at 6:15 PM

Okay, this has been resolved.  I had to change the way the parsing of the date parts.  Can you download the latest source and test it out for me?

May 12, 2011 at 7:12 AM

I've tested it and it works like a charm.

Thank you very much for your fast support!