Configure a custom date to use as starting point in the datepicker

51 Views Asked by At

I'm trying to configure the datepicker from angular-ui.bootstrap to have a starting point date when user pops up the datepicker.

I found out this line of code actually works.

$scope.date = new Date(1980-12-12);

It actually put the value at the input-box and also the picker. But I want my input-box to be empty initially. Instead I want the placeholder to be shown.

2

There are 2 best solutions below

0
On

Please, try using the placeholder attribute.

Something like this

<input type="text" placeholder="{{date}}" ... />
0
On

Try to use placeholder attribute.

<input type="text" name="datepicker" placeholder="{{date}}" value="" ... />