fr-CA dateFormater

2 posts, 0 answers
  1. Guillaume
    Guillaume avatar
    6 posts
    Member since:
    Feb 2015

    Posted 10 Jul 2015 Link to this post

    Hi, I'm having a problem with the date format when I parse a date and its doesn't show the right date.

    I set RadDatePicker Culture to fr-CA xaml side. and my application culture + cultureUI is set to fr-CA

    I parse 03/07/2015 --> it shows 2015-03-07 = March 07 2015 it should be July 03 2015 (2015-07-03)

    CodeSnipet Below.

    <telerik:RadDatePicker  Grid.Column="1" Grid.Row="1"Style="{StaticResource leftRadDatePicker_style}"  Name="dateFacture"DateTimeWatermarkContent="{x:Static resources:Facture.DateWaterMark}"SelectedDate="{Binding DateFacture, Mode=TwoWay,UpdateSourceTrigger=PropertyChanged,NotifyOnValidationError=True}">  </telerik:RadDatePicker >

    <Style TargetType="telerik:RadDatePicker" x:Key="leftRadDatePicker_style">
            <Setter Property="Height" Value="36" />
            <Setter Property="FontSize" Value="16" />
            <Setter Property="VerticalAlignment" Value="Top" />
            <Setter Property="Culture" Value="fr-CA" />
            <Setter Property="Margin" Value="20,5,20,0" />
            <!--<Setter Property="Template" Value="{DynamicResource RadDatePickerControlTemplate}"/>-->
            <Setter Property="Validation.ErrorTemplate">
                            <!-- Placeholder for the TextBox itself -->
                            <AdornedElementPlaceholder x:Name="textbox"/>
                            <TextBlock Text="{Binding [0].ErrorContent}" Style="{StaticResource ErrorText_style}" />
                <Trigger Property="IsKeyboardFocusWithin" Value="True">
                    <Setter Property="IsDropDownOpen" Value="True" />

    Thread.CurrentThread.CurrentCulture = new CultureInfo(ConfigurationManager.AppSettings["Culture"]);//Is fr-CA
    Thread.CurrentThread.CurrentUICulture = new CultureInfo(ConfigurationManager.AppSettings["Culture"]);//Is fr-CA




  2. Nasko
    Nasko avatar
    557 posts

    Posted 13 Jul 2015 Link to this post

    Hi Guillaume,

    The observed by you behavior of RadDatePicker is an expected one as this is how the parser works in its current implementation. However, you could implement you own custom parsing logic that suits your needs using the ParseDateTimeValue event. Please check the following article from our help documentation that provides detailed information how to achieve this:

    Hopes this helps.

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. DevCraft banner
Back to Top