Skip to content

Commit

Permalink
fix(module: calendar): should get extra cell class name from cell not…
Browse files Browse the repository at this point in the history
… row (#620)
  • Loading branch information
qar authored and 3fuyu committed Nov 29, 2019
1 parent 89bd218 commit 0a11514
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions components/calendar/calendar.component.spec.ts
Expand Up @@ -58,7 +58,7 @@ describe('CalendarComponent', () => {
component.state.now = new Date(2018, 8, 2);
const disableDay = component.state.now.getDate() + 5 + '';
fixture.detectChanges();
expect(calendarEle.nativeElement.querySelector('.row .cell .disable').innerText).toContain(
expect(calendarEle.nativeElement.querySelector('.row .cell.extra-classname .disable').innerText).toContain(
disableDay,
'getDateExtra is right'
);
Expand Down Expand Up @@ -422,10 +422,10 @@ describe('CalendarComponent', () => {

const extra = {};
const now = new Date(2018, 8, 2);
extra[+new Date(now.getFullYear(), now.getMonth(), now.getDate() + 5)] = { info: 'Disable', disable: true };
extra[+new Date(now.getFullYear(), now.getMonth(), now.getDate() + 6)] = { info: 'Disable', disable: true };
extra[+new Date(now.getFullYear(), now.getMonth(), now.getDate() + 7)] = { info: 'Disable', disable: true };
extra[+new Date(now.getFullYear(), now.getMonth(), now.getDate() + 8)] = { info: 'Disable', disable: true };
extra[+new Date(now.getFullYear(), now.getMonth(), now.getDate() + 5)] = { info: 'Disable', cellCls: 'extra-classname', disable: true };
extra[+new Date(now.getFullYear(), now.getMonth(), now.getDate() + 6)] = { info: 'Disable', cellCls: 'extra-classname', disable: true };
extra[+new Date(now.getFullYear(), now.getMonth(), now.getDate() + 7)] = { info: 'Disable', cellCls: 'extra-classname', disable: true };
extra[+new Date(now.getFullYear(), now.getMonth(), now.getDate() + 8)] = { info: 'Disable', cellCls: 'extra-classname', disable: true };

for (const key in extra) {
if (extra.hasOwnProperty(key)) {
Expand Down
Expand Up @@ -5,7 +5,7 @@
<div *ngFor="let row of state.weekComponents; let i = index" [ngClass]="row.rowCls">
<div
*ngFor="let cell of row.weeksDataList; let j = index"
class="{{ 'cell ' + ((row.extra && row.extra.cellCls) || '') }}"
class="{{ 'cell ' + ((cell.extra && cell.extra.cellCls) || '') }}"
(click)="onClickCell(cell)"
>
<div *ngIf="row.extra && row.extra.cellRender">test</div>
Expand Down

0 comments on commit 0a11514

Please sign in to comment.