Skip to content

Commit f381274

Browse files
authored
Format end date before setting to filter conditions (#114)
* Format end date before setting to filter conditions * Select Highlight when the option is unselected
1 parent ca3ac94 commit f381274

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/ng-generate/components/shared/generators/services/filter/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ function getDateRemote(values: PropValue[]): string {
305305
conditions.push(new Ge(timeType, \`\${startDateUTC}\`));
306306
}
307307
if (endDateUTC) {
308-
conditions.push(new Le(timeType, \`\${endDateUTC}\`));
308+
conditions.push(new Le(timeType, \`\${endDateUTC.toISOString()}\`));
309309
}
310310
if (conditions.length > 0) {
311311
query.addNode(conditions.length > 1 ? new And(conditions) : conditions[0]);

src/ng-generate/components/table/generators/directives/highlight/files/__name@dasherize__.directive.ts.template

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,10 @@ export class <%= classify(name) %>Directive implements OnChanges, OnInit {
4343
constructor(private el: ElementRef, private sanitizer: DomSanitizer) {}
4444

4545
ngOnChanges(changes: HighlightSimpleChanges) {
46-
if ((changes.highlight && !changes.highlight.firstChange) || (changes.caseSensitive && !changes.caseSensitive.firstChange)) {
46+
if ((changes.highlight && !changes.highlight.firstChange) ||
47+
(changes.caseSensitive && !changes.caseSensitive.firstChange) ||
48+
(changes.selected && !changes.selected.firstChange)
49+
) {
4750
this.handleHighlightText();
4851
}
4952
}
@@ -159,7 +162,6 @@ export class <%= classify(name) %>Directive implements OnChanges, OnInit {
159162
}
160163

161164
private clearHighlights(): void {
162-
const content = this.sanitizer.sanitize(SecurityContext.STYLE, this.el.nativeElement.innerText);
163-
(this.el.nativeElement as HTMLElement).innerHTML = content;
165+
(this.el.nativeElement as HTMLElement).innerHTML = this.highlightSource;
164166
}
165167
}

0 commit comments

Comments
 (0)