Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CustomDateSummary result #425

Merged
merged 6 commits into from
Dec 13, 2018
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { employeesData } from './localData';
export class GridSummariesComponent implements OnInit {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The classname should be templated. -> $(ClassName)Component

if you add two template with any name the build will fail.

@ViewChild('sampleGrid', { read: IgxGridComponent })
public sampleGrid: IgxGridComponent;
customDateSummary = CustomDateSummary;
public customDateSummary = CustomDateSummary;

public localData: any[];
title = 'Grid Summaries';
Expand All @@ -32,7 +32,7 @@ export class GridSummariesComponent implements OnInit {
if (this.sampleGrid.getColumnByName(name).hasSummary) {
this.sampleGrid.disableSummaries(name);
} else {
this.sampleGrid.enableSummaries(name, this.customDateSummary);
this.sampleGrid.enableSummaries(name);
}
}
}
Expand All @@ -47,12 +47,12 @@ class CustomDateSummary extends IgxDateSummaryOperand {
result.push({
key: 'earliest',
label: 'Earliest Date',
summaryResult: (IgxDateSummaryOperand.earliest(data)).toLocaleDateString()
summaryResult: data.length ? (IgxDateSummaryOperand.earliest(data)).toLocaleDateString() : null
});
result.push({
key: 'latest',
label: 'Latest Date',
summaryResult: (IgxDateSummaryOperand.latest(data)).toLocaleDateString()
summaryResult: data.length ? (IgxDateSummaryOperand.latest(data)).toLocaleDateString() : null
});

return result;
Expand Down