Unplanned
Last Updated: 29 Apr 2020 07:13 by Daniel
Robert
Created on: 09 Feb 2020 21:26
Category: DatePicker
Type: Feature Request
10
Placeholder for DatePicker (and the other date inputs)

How to remove placeholder from DatePicker?

If I set DateFormat to "d" then DatePicker will have "d" as a placeholder which confuses my users. How can I set custom placeholder or remove the placeholder from the DatePicker control?

Best regards,

Robert

2 comments
Daniel
Posted on: 29 Apr 2020 07:13

@Robert

I have the same requirement hence +1 for this thread. You can use the following workaround to hide the placeholder when no value is given:

<TelerikDateInput Value="@Value" Format="@Format" 
...
@{
  private DateTime? Value { get; set; }
  private string Format { get; set; }

  // code section

  Format = Value.HasValue ? "d" : "";
}
ADMIN
Marin Bratanov
Posted on: 10 Feb 2020 10:04

Hello Robert,

I moved this thread to the public feedback portal so you can Follow the status of such a feature (I took the liberty of tweaking the title a little): https://feedback.telerik.com/blazor/1452940-placeholder-for-datepicker-and-the-other-date-inputs.

At the moment, all the date inputs (which all boil down to a TelerikDateInput) show their Format as a placeholder. Options I can suggest are as workarounds:

  • have a default value so that the user sees an actual date
  • use a custom format string (see the supported ones here) that is a little more verbose (like the default one) so the user sees a more meaningful hint

Regards,
Marin Bratanov
Progress Telerik

 UI for Blazor