0

How to hide default date format description in KendoUi Angular DatePicker: https://www.telerik.com/kendo-angular-ui/components/dateinputs/datepicker/#toc-formats

In example, usual datepicker code is like:

<kendo-datepicker [value]="value"></kendo-datepicker>

and when "value" is null or empty it shows you a prompt:

month/day/year

How to hide that prompt?

EDIT: This functionality is being in development. It should be realesed soon.

3 Answers 3

1

With the latest changes in the DateInput (as of v1.4.0-dev) two additional properties were added:

  • placeholder - display text hint (related Github issue)
  • formatPlaceholder - control description of the format sections (Github issue)

With those available, we can easily hide or modify the displayed format description:

<kendo-datepicker [placeholder]="Enter date..." [formatPlaceholder]="short" />

Here is a plunker demo that demonstrates those new properties:

http://plnkr.co/edit/XYmwDjkpp7Mb4txlmc2L?p=preview

Note, that the described functionality is available only in the @dev channel. It should be released soon though.

EDIT: @progress/[email protected] is officially released. Just use 1.4.0 or above to utilize some of the mentioned options.

Sign up to request clarification or add additional context in comments.

4 Comments

I have run yourt plunker on chrome and shows nothing on preview :(
This is strange. It seems to work on my end - screencast.com/t/244mTlyVr . Another option is to just build a simple Angular app using the @progress/kendo-angular-dateinputs@dev package.
I found the issue - the plunker used intranet link. The demo is updated and should work as expected. – George K 4 hours ago
Thanks. Now it works. placeholder=" " is almost what I need.
1

The issue is with kendo datepicker place holder property.

The DateInput and DatePicker components expose a placeholder property incorrectly. By default, the date format string, e.g. month/day/year, is displayed.

You can get more details on #519.

Comments

1

I think there's no way to do this programmatically, however I have an idea of how to do that and I briefly tested it in Chrome Dev Tools.

Put some class on your datepicker component

<kendo-datepicker [ngClass]={'empty': !date }>

Then add styles

.k-datepicker.empty input {
    text-indent: -9999px;
}

That should do the trick.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.