Skip to content

Commit

Permalink
Merge branch 'release/2.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
fetrarij committed Feb 4, 2019
2 parents 95f0016 + ccad53b commit e5bdc49
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 44 deletions.
1 change: 1 addition & 0 deletions demo/src/app/simple/simple.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<div class="col s6">
<input type="text" ngxDaterangepickerMd
[(ngModel)]="selected" class="form-control" placeholder="Choose date"
[showDropdowns]="true"
(ngModelChange)="ngModelChange($event)" (change)="change($event)" showCancel="true"
/>
</div>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ngx-daterangepicker-material",
"version": "1.3.3",
"version": "2.0.0",
"description": "Angular 2+ date range picker (with material design theme)",
"keywords": [
"angular2",
Expand Down
8 changes: 4 additions & 4 deletions src/daterangepicker/daterangepicker.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
</ng-container>
<th colspan="5" class="month drp-animate">
<ng-container *ngIf="showDropdowns && calendarVariables.left.dropdowns">
<div>
<div class="dropdowns">
{{this.locale.monthNames[calendarVariables?.left?.calendar[1][1].month()]}}
<select class="monthselect" (change)="monthChanged($event, sideEnum.left)">
<option
Expand All @@ -44,7 +44,7 @@
</option>
</select>
</div>
<div>
<div class="dropdowns">
{{ calendarVariables?.left?.calendar[1][1].format(" YYYY")}}
<select class="yearselect" (change)="yearChanged($event, sideEnum.left)">
<option *ngFor="let y of calendarVariables.left.dropdowns.yearArrays" [selected]="y === calendarVariables.left.dropdowns.currentYear">
Expand Down Expand Up @@ -126,7 +126,7 @@
</ng-container>
<th colspan="5" class="month">
<ng-container *ngIf="showDropdowns && calendarVariables.right.dropdowns">
<div>
<div class="dropdowns">
{{this.locale.monthNames[calendarVariables?.right?.calendar[1][1].month()]}}
<select class="monthselect" (change)="monthChanged($event, sideEnum.right)">
<option
Expand All @@ -136,7 +136,7 @@
</option>
</select>
</div>
<div>
<div class="dropdowns">
{{ calendarVariables?.right?.calendar[1][1].format(" YYYY")}}
<select class="yearselect" (change)="yearChanged($event, sideEnum.right)">
<option *ngFor="let y of calendarVariables.right.dropdowns.yearArrays" [selected]="y === calendarVariables.right.dropdowns.currentYear">
Expand Down
80 changes: 44 additions & 36 deletions src/daterangepicker/daterangepicker.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -349,43 +349,51 @@ $input-height: 3rem !default;
}
}

select {
display: inline-block;
background-color: $select-background;
width: 100%;
padding: $select-padding;
border: $select-border;
border-radius: $select-radius;
height: $input-height;
&.monthselect, &.yearselect {
font-size: 12px;
padding: 1px;
height: auto;
margin: 0;
cursor: default;
}
&.hourselect,
&.minuteselect,
&.secondselect,
&.ampmselect {
width: 50px;
margin: 0 auto;
background: #eee;
border: 1px solid #eee;
padding: 2px;
outline: 0;
font-size: 12px;
}
.dropdowns {
background-repeat: no-repeat;
background-size: 10px;
background-position-y: center;
background-position-x: right;
width: 50px;
background-image: url(data:image/svg+xml;utf8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTYuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0iQ2FwYV8xIiB4PSIwcHgiIHk9IjBweCIgd2lkdGg9IjE2cHgiIGhlaWdodD0iMTZweCIgdmlld0JveD0iMCAwIDI1NSAyNTUiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDI1NSAyNTU7IiB4bWw6c3BhY2U9InByZXNlcnZlIj4KPGc+Cgk8ZyBpZD0iYXJyb3ctZHJvcC1kb3duIj4KCQk8cG9seWdvbiBwb2ludHM9IjAsNjMuNzUgMTI3LjUsMTkxLjI1IDI1NSw2My43NSAgICIgZmlsbD0iIzk4OGM4YyIvPgoJPC9nPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+Cjwvc3ZnPgo=);
select {
display: inline-block;
background-color: $select-background;
width: 100%;
padding: $select-padding;
border: $select-border;
border-radius: $select-radius;
height: $input-height;
&.monthselect, &.yearselect {
font-size: 12px;
padding: 1px;
height: auto;
margin: 0;
cursor: default;
}
&.hourselect,
&.minuteselect,
&.secondselect,
&.ampmselect {
width: 50px;
margin: 0 auto;
background: #eee;
border: 1px solid #eee;
padding: 2px;
outline: 0;
font-size: 12px;
}

&.monthselect,
&.yearselect {
cursor: pointer;
opacity: 0;
position: absolute;
top: 0;
left: 0;
margin: 0;
padding: 0;
&.monthselect,
&.yearselect {
cursor: pointer;
opacity: 0;
position: absolute;
top: 0;
left: 0;
margin: 0;
padding: 0;
}
}
}

Expand Down
3 changes: 0 additions & 3 deletions src/daterangepicker/daterangepicker.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -533,9 +533,6 @@ export class DaterangepickerComponent implements OnInit {
// this.updateElement();
}
this.updateMonthsInView();
if (this.autoApply) {
this.datesUpdated.emit({startDate: this.startDate, endDate: this.endDate});
}
}
@Input()
isInvalidDate(date) {
Expand Down

0 comments on commit e5bdc49

Please sign in to comment.