For Dutch Culture, DatePicker shows 21-00-1980 minimised byt 21 December 1980 maximised, yet English Culture 21-12-1980 min and 21 December 1980 max

4 posts, 0 answers
  1. Anthony
    Anthony avatar
    8 posts
    Member since:
    Nov 2012

    Posted 12 Dec 2012 Link to this post

    Hi,

    I'm experiencing difficulties with DatePicker localisation (but just with the displayed date as I have succesfully localised it for Dutch and German for the localisation strings EmptyDateContent, LeapYear, and DatePickerPopupHeader, having put the following line before InitializeComponent() in the constructor of the page hosting the RadDatePicker:

    Telerik.Windows.Controls.InputLocalizationManager.Instance.ResourceManager = AppResources.ResourceManager;

    That points to those strings in AppResources.resx, AppResources.nl-NL.resx, and AppResources.de-DE.resx
    for English (Default), Dutch, and German, respectively.


    But as for the display of the date itself:

    For the default English localisation, it is fine, displaying 21-12-1980 minimised and 21 December 1980 maximised.

    However for the Dutch Culture, it shows 21-00-1980 minimised but 21 December 1980 maximised. Why the -00- for -12- and how to fix it for NL?

    I've checked the Xaml binding with the ViewModel i.e. Value="{Binding DateOfBirth, Mode=TwoWay}" and on the breakpoint in the ViewModel it shows a date of {21-12-1961 0:00:00} for DateOfBirth.

    Here's my Xaml:

                    <telerikInput:RadDatePicker x:Name="DatePicker" PopupHeader="" Grid.Column="0" SelectorFormat="{Binding DatePickerFormat}" DisplayValueFormat="{Binding DatePickerFormat}" EmptyContent="{Binding}" Value="{Binding DateOfBirth, Mode=TwoWay}" PickerButtonStyle="{StaticResource VCRadDatePickerButtonStyle}" VerticalAlignment="Top" CancelButtonIconUri="/Images/Telerik/DateTimePickerCancel.png" OkButtonIconUri="/Images/Telerik/DateTimePickerOk.png" telerikCore:InteractionEffectManager.IsInteractionEnabled="False"><br>                    <telerikInput:RadDatePicker.EmptyContentTemplate><br>                        <DataTemplate><br>                            <TextBlock Text="{Binding DateOfBirthWatermark}" Foreground="{StaticResource WatermarkTextBrush}" FontFamily="Segoe WP" Opacity="0.5"></TextBlock><br>                        </DataTemplate><br>                    </telerikInput:RadDatePicker.EmptyContentTemplate><br>                </telerikInput:RadDatePicker>


    Any hints?

    Kind regards,

    Anthony
  2. Deyan
    Admin
    Deyan avatar
    2039 posts

    Posted 15 Dec 2012 Link to this post

    Hi Anthony,

    We've handled your ticket. Please take a look at it.

    As soon as we come up with a solution for the case, we will also update this thread to help other people who might come across it.

    Kind regards,
    Deyan
    the Telerik team
    Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
  3. DevCraft banner
  4. Anthony
    Anthony avatar
    1 posts
    Member since:
    Dec 2012

    Posted 17 Dec 2012 Link to this post

    Thanks Deylan!
  5. Deyan
    Admin
    Deyan avatar
    2039 posts

    Posted 20 Dec 2012 Link to this post

    Hello Anthony,

    This is a quick follow-up with some further information about the issue you have reported here.

    The reason for the undesired behavior hides in the Date Time Format you have provided for the Dutch culture specifically. The format is dd/mm/yyyy. Here, the lower-case mm stays for Minutes and therefore you see 00 instead of 12 or whatever month is selected. You should change this to upper-case MM in order to designate the months portion of the DateTime structure:

    dd/MM/yyyy

    I hope this helps.

    Kind regards,
    Deyan
    the Telerik team
    Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
Back to Top