File tree Expand file tree Collapse file tree 3 files changed +23
-11
lines changed
src/app/modules/shared/components/month-picker Expand file tree Collapse file tree 3 files changed +23
-11
lines changed Original file line number Diff line number Diff line change 1
1
< div class ="card-header ">
2
- < div class ="d-flex align-items-center ">
3
- < button class ="btn mr-auto " (click) ="changeYear('subtract') ">
4
- < i class ="fa fa-chevron-left "> </ i >
5
- </ button >
6
- < p >
7
- {{selectedYearText}}
8
- </ p >
9
- < button class ="btn ml-auto " (click) ="changeYear('add') ">
10
- < i class ="fa fa-chevron-right "> </ i >
11
- </ button >
2
+ < div class ="row align-items-center ">
3
+ < div class ="col-sm-4 ">
4
+ < button class ="btn mr-auto " (click) ="changeYear('subtract') ">
5
+ < i class ="fa fa-chevron-left "> </ i >
6
+ </ button >
7
+ </ div >
8
+ < div class ="col-sm-4 ">
9
+ < p class ="text-center year-text ">
10
+ {{selectedYearText}}
11
+ </ p >
12
+ </ div >
13
+
14
+ < div class ="col-sm-4 text-right ">
15
+ < button *ngIf ="selectedYear < currentYear " class ="btn ml-auto " (click) ="changeYear('add') ">
16
+ < i class ="fa fa-chevron-right "> </ i >
17
+ </ button >
18
+ </ div >
12
19
</ div >
13
20
</ div >
14
21
< div class ="row content-months ">
Original file line number Diff line number Diff line change 9
9
margin : 0 ;
10
10
}
11
11
12
+ .year-text {
13
+ margin-bottom : 0 ;
14
+ }
15
+
12
16
.month {
13
17
background : $primary ;
14
18
color : white ;
Original file line number Diff line number Diff line change @@ -16,10 +16,11 @@ export class MonthPickerComponent implements OnInit {
16
16
selectedMonthIndex : number ;
17
17
selectedYearMoment : moment . Moment ;
18
18
selectedYear : number ;
19
-
20
19
selectedYearText : string ;
21
20
months : Array < string > = [ ] ;
22
21
22
+ currentYear = new Date ( ) . getFullYear ( ) ;
23
+
23
24
constructor ( ) {
24
25
this . selectedYearMoment = moment ( ) ;
25
26
this . selectedMonthMoment = moment ( ) ;
You can’t perform that action at this time.
0 commit comments