-
Notifications
You must be signed in to change notification settings - Fork 6.7k
feat(datepicker): Provide a 'today' flag on the day object #1551
Conversation
@bekos would you mind reviewing this one? |
@@ -14,7 +14,7 @@ | |||
<tr ng-repeat="row in rows"> | |||
<td ng-show="showWeekNumbers" class="text-center"><em>{{ getWeekNumber(row) }}</em></td> | |||
<td ng-repeat="dt in row" class="text-center"> | |||
<button type="button" style="width:100%;" class="btn btn-default btn-sm" ng-class="{'btn-info': dt.selected}" ng-click="select(dt.date)" ng-disabled="dt.disabled"><span ng-class="{'text-muted': dt.secondary}">{{dt.label}}</span></button> | |||
<button type="button" style="width:100%;" class="btn btn-default btn-sm" ng-class="{'btn-info': dt.selected, 'today': dt.today}" ng-click="select(dt.date)" ng-disabled="dt.disabled"><span ng-class="{'text-muted': dt.secondary}">{{dt.label}}</span></button> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@perry I am not keen of adding dummy CSS classes like today
. You have to provide a nice visual hint for the default template also. Anyone can override the default template later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's probably best to use .text-primary
or .text-info
and not a button class since that would put to much (visual) focus on today
, compared to the currently selected day.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Totally agree with @bekos here. We either need to remove this class from the default template or, better yet, make use of on bootstrap class to highlight "today".
@perry This is a nice feature we would like to add 👍 . Left some comments on the code, but I would also prefer to support this for every mode, not just the |
@perry there are some comments in the PR, could you have a look at those? Also, could you please rebase your PR on top of the current master? |
Thanks for the feedback everyone. I'll try and work on this as soon as I get the chance. |
This adds a highlight to the button if it matches todays date.