TelerikDatePicker Format (Client-side)

2 posts, 0 answers
  1. Henri
    Henri avatar
    88 posts
    Member since:
    Aug 2008

    Posted 14 May 2019 Link to this post

    Dear Telerik,

    I have a question regarding the TelerikDatePicker's Format property.
    I have set the format to "dd/MM/yyyy"

    <TelerikDatePicker Format="dd/MM/yyyy"  bind-Value="@DatePickerValue" ValueChanged="@OnDateChanged"></TelerikDatePicker>

    But the Picker still displays the date as yyyy-MM-dd.

    I have tried various ways, including setting the CultureInfo in different ways, but nothing seams to help.

    Do you have a solution for this ?





  2. Marin Bratanov
    Marin Bratanov avatar
    5008 posts

    Posted 14 May 2019 Link to this post

    Hello Gert,

    Can you confirm you have the JS interop file registered, with the correct version, as explained here:

     Here's some code I used to test this, and at the end of this post you will find a screenshot of what I see in the browser:

    @using Telerik.Blazor.Components.DateInput
    <TelerikDateInput Format="dd/MM/yyyy" bind-Value="@DatePickerValue"></TelerikDateInput>
    <br />
    No explicit format
    <TelerikDateInput Format="dd/MM/yyyy" bind-Value="@DatePickerValue"></TelerikDateInput>
    <br />
    Format="yyyy MMM dd"
    <TelerikDateInput Format="yyyy MMM dd" bind-Value="@DatePickerValue"></TelerikDateInput>
    <br />
    @functions {
        DateTime DatePickerValue { get; set; } = DateTime.Now;

    Also, version 1.1.0 is planned for tomorrow, so you could give that a try as well.

    That said, we rely on the framework to provide the formatting and Blazor still has issues with date formatting and localization: and Also, at the moment, the ValueChanged handler is also blocked by this: The framework is still young and is bound to have some hiccups yet and date formatting and handling still seems to be one of them.

    Marin Bratanov
    Progress Telerik UI for Blazor
Back to Top