mirror of
https://github.com/HackPlan/angular-datepicker.git
synced 2026-01-12 22:44:06 +08:00
fixed now highlight
This commit is contained in:
@@ -263,7 +263,10 @@ Module.directive('datePicker', function datePickerDirective(datePickerConfig) {
|
||||
var now = scope.now;
|
||||
//noinspection FallThroughInSwitchStatementJS
|
||||
switch (scope.view) {
|
||||
case 'hour':
|
||||
case 'minutes':
|
||||
is &= ~~(date.getMinutes()/step) === ~~(now.getMinutes()/step);
|
||||
/*falls through*/
|
||||
case 'hours':
|
||||
is &= date.getHours() === now.getHours();
|
||||
/*falls through*/
|
||||
case 'date':
|
||||
|
||||
@@ -64,12 +64,16 @@
|
||||
|
||||
}
|
||||
|
||||
.active {
|
||||
.active , .now{
|
||||
.buttonBackground(@btnPrimaryBackground, spin(@btnPrimaryBackground, 20));
|
||||
color: #fff;
|
||||
text-shadow: 0 -1px 0 rgba(0, 0, 0, .25);
|
||||
}
|
||||
|
||||
.now {
|
||||
.buttonBackground(@btnDangerBackground, spin(@btnDangerBackground, 20));
|
||||
}
|
||||
|
||||
.disabled {
|
||||
background: none;
|
||||
color: #999999 !important;
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<tbody>
|
||||
<tr ng-repeat="week in weeks">
|
||||
<td ng-repeat="day in week"
|
||||
ng-class="{'active':isSameDay(day),'disabled':(day.getMonth()!=date.getMonth()),'after':isAfter(day),'before':isBefore(day)}"
|
||||
ng-class="{'now':isNow(day),'active':isSameDay(day),'disabled':(day.getMonth()!=date.getMonth()),'after':isAfter(day),'before':isBefore(day)}"
|
||||
ng-click="setDate(day)" ng-bind="day.getDate()">
|
||||
</td>
|
||||
</tr>
|
||||
@@ -33,7 +33,7 @@
|
||||
<tbody>
|
||||
<tr>
|
||||
<td colspan="7">
|
||||
<span ng-class="{'active':isSameYear(year),'btn-danger':isNow(year)}"
|
||||
<span ng-class="{'active':isSameYear(year),'now':isNow(year)}"
|
||||
ng-repeat="year in years"
|
||||
ng-click="setDate(year)" ng-bind="year.getFullYear()"></span>
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
<tr>
|
||||
<td colspan="7">
|
||||
<span ng-repeat="month in months"
|
||||
ng-class="{'active':isSameMonth(month),'after':isAfter(month),'before':isBefore(month),'btn-danger':isNow(month)}"
|
||||
ng-class="{'active':isSameMonth(month),'after':isAfter(month),'before':isBefore(month),'now':isNow(month)}"
|
||||
ng-click="setDate(month)">{{month|date:'MMM'}}</span>
|
||||
|
||||
</td>
|
||||
@@ -77,7 +77,7 @@
|
||||
<tr>
|
||||
<td colspan="7">
|
||||
<span ng-repeat="hour in hours"
|
||||
ng-class="{'old':isOldHour(hour),'new':isNewHour(hour),'active':isSameHour(hour)}"
|
||||
ng-class="{'now':isNow(hour),'active':isSameHour(hour)}"
|
||||
ng-click="setDate(hour)" ng-bind="hour.getHours()+':00'"></span>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -98,7 +98,7 @@
|
||||
<tr>
|
||||
<td colspan="7">
|
||||
<span ng-repeat="minute in minutes"
|
||||
ng-class="{active:isSameMinutes(minute)}"
|
||||
ng-class="{active:isSameMinutes(minute),'now':isNow(minute)}"
|
||||
ng-click="setDate(minute)">{{minute|date:"HH:mm"}}</span>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
2
dist/index.min.js
vendored
2
dist/index.min.js
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user