Skip to content

Commit e533ee9

Browse files
committed
fix(daypicker): glyphicon arrows, disable and colspan attributes
1 parent ae8c617 commit e533ee9

File tree

1 file changed

+15
-16
lines changed

1 file changed

+15
-16
lines changed

components/datepicker/daypicker.ts

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ const TEMPLATE_OPTIONS:any = {
2121
<span [ngClass]="{'text-muted': dtz.secondary || dtz.current}">{{dtz.label}}</span>
2222
</button>
2323
</td>
24-
`
24+
`,
25+
ARROW_LEFT: '&lt;',
26+
ARROW_RIGHT: '&gt;'
2527
},
2628
[Ng2BootstrapTheme.BS3]: {
2729
DAY_TITLE: `
@@ -38,6 +40,12 @@ const TEMPLATE_OPTIONS:any = {
3840
<span [ngClass]="{'text-muted': dtz.secondary, 'text-info': dtz.current}">{{dtz.label}}</span>
3941
</button>
4042
</td>
43+
`,
44+
ARROW_LEFT: `
45+
<i class="glyphicon glyphicon-chevron-left"></i>
46+
`,
47+
ARROW_RIGHT: `
48+
<i class="glyphicon glyphicon-chevron-right"></i>
4149
`
4250
}
4351
};
@@ -52,30 +60,21 @@ const CURRENT_THEME_TEMPLATE:any = TEMPLATE_OPTIONS[Ng2BootstrapConfig.theme ||
5260
<tr>
5361
<th>
5462
<button type="button" class="btn btn-default btn-secondary btn-sm pull-left" (click)="datePicker.move(-1)" tabindex="-1">
55-
<i class="glyphicon glyphicon-chevron-left"></i>
56-
</button>
57-
</th>
58-
<th colspan="5" [hidden]="datePicker.showWeeks">
59-
<button [id]="datePicker.uniqueId + '-title'"
60-
type="button" class="btn btn-default btn-secondary btn-sm"
61-
(click)="datePicker.toggleMode()"
62-
[disabled]="datePicker.datepickerMode === maxMode"
63-
[ngClass]="{disabled: datePicker.datepickerMode === maxMode}" tabindex="-1" style="width:100%;">
64-
<strong>{{title}}</strong>
63+
${CURRENT_THEME_TEMPLATE.ARROW_LEFT}
6564
</button>
6665
</th>
67-
<th colspan="6" [hidden]="!datePicker.showWeeks">
66+
<th [attr.colspan]="5 + datePicker.showWeeks">
6867
<button [id]="datePicker.uniqueId + '-title'"
6968
type="button" class="btn btn-default btn-secondary btn-sm"
7069
(click)="datePicker.toggleMode()"
71-
[disabled]="datePicker.datepickerMode === maxMode"
72-
[ngClass]="{disabled: datePicker.datepickerMode === maxMode}" tabindex="-1" style="width:100%;">
70+
[disabled]="datePicker.datepickerMode === datePicker.maxMode"
71+
[ngClass]="{disabled: datePicker.datepickerMode === datePicker.maxMode}" tabindex="-1" style="width:100%;">
7372
<strong>{{title}}</strong>
7473
</button>
7574
</th>
7675
<th>
7776
<button type="button" class="btn btn-default btn-secondary btn-sm pull-right" (click)="datePicker.move(1)" tabindex="-1">
78-
<i class="glyphicon glyphicon-chevron-right"></i>
77+
${CURRENT_THEME_TEMPLATE.ARROW_RIGHT}
7978
</button>
8079
</th>
8180
</tr>
@@ -150,7 +149,7 @@ export class DayPicker implements OnInit {
150149
firstDate.setDate(-numDisplayedFromPreviousMonth + 1);
151150
}
152151

153-
// 42 is the number of days on a six-month calendar
152+
// 42 is the number of days on a six-week calendar
154153
let _days:Array<Date> = self.getDates(firstDate, 42);
155154
let days:Array<any> = [];
156155
for (let i = 0; i < 42; i++) {

0 commit comments

Comments
 (0)