Angular Bootstrap DateTimePicker - Highlight Today on embedded Calender

Please accept my apologies if I had errors in my post. This is my first post here. But I'm not new to StackOverflow. Correct me, if any.

I am using the angular-bootstrap-datetimepicker library from the URL below: Link to the library

I am currently implementing a calendar on the page. I use angular.js, moment.js, grunt and bower. There is absolutely no problem downloading the calendar, as well as the ability to select a date and display the selected date.

Here is a sample code:

<div> Selected Date: {{ data.embeddedDate | date:'yyyy-MMM-dd' }} <datetimepicker data-ng-model="data.embeddedDate" data-datetimepicker-config="{ startView:'day', minView:'day'}" /> </div> 

I am trying to highlight today's date automatically when the datetimepicker is showing on the page. As you can see, in the configuration settings, I could set the default view and view mines.

Note. I tried to imitate the working code (so far) in Plunkr, but did not show the calendar. I have added all the libraries. In any case, this is just for the idea. If I could get Plunkr to work, I will update it again. Here is a link to Plunkr .

Any suggestions (regarding highlighting the default date by default) will be appreciated.

+5
source share
1 answer

To get a directive to show today's default date, you can set the data.embeddedDate value in the controller in your area, for example:

 $scope.data = { embeddedDate: new Date() }; 

Working plunkr

+2
source

All Articles