Skip to content

Commit

Permalink
fix(date-picker): fix invaild date
Browse files Browse the repository at this point in the history
style(date-picker): fix ios mask index
test(pagination): update pagination test
  • Loading branch information
BronzeCui committed Sep 30, 2018
1 parent a3c6150 commit 6620635
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion components/date-picker/date-picker.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ export class DatePickerComponent implements OnInit, OnDestroy, AfterViewInit {
} else {
result = this.resultArr.map(v => v).join('-');
}
this.resultDate = new Date(result);
this.resultDate = new Date(result.replace(/-/g, '/'));
if (this.options.minDate.getTime() > this.resultDate.getTime()) {
if (this.resultArr.length > 0) {
for (let index = 0; index < this.resultArr.length; index++) {
Expand Down
4 changes: 2 additions & 2 deletions components/pagination/pagination.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ describe('pagination', () => {
it('should local work', () => {
nextButton = paginationEle.nativeElement.querySelector('.am-pagination-wrap-btn-next').firstElementChild;
prevButton = paginationEle.nativeElement.querySelector('.am-pagination-wrap-btn-prev').firstElementChild;
expect(prevButton.firstElementChild.innerText.trim()).toBe(component.locale.prevText);
expect(nextButton.firstElementChild.innerText.trim()).toBe(component.locale.nextText);
expect(prevButton.lastElementChild.innerText.trim()).toBe(component.locale.prevText);
expect(nextButton.lastElementChild.innerText.trim()).toBe(component.locale.nextText);
});

it('should onChange work', () => {
Expand Down
6 changes: 2 additions & 4 deletions components/picker/style/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
position: fixed;
width: 100%;
background-color: @fill-base;
-webkit-transform: translateZ(1px);
transform: translateZ(1px);

&-wrap {
position: fixed;
Expand All @@ -21,8 +23,6 @@
z-index: @picker-zindex;
-webkit-overflow-scrolling: touch;
outline: 0;
-webkit-transform: translateZ(1px);
transform: translateZ(1px);
}

&-mask {
Expand All @@ -34,8 +34,6 @@
background-color: @fill-mask;
height: 100%;
z-index: @picker-zindex;
-webkit-transform: translateZ(1px);
transform: translateZ(1px);

&-hidden {
display: none;
Expand Down

0 comments on commit 6620635

Please sign in to comment.