Skip to content
Snippets Groups Projects
Commit 7bd41efa authored by OZGCloud's avatar OZGCloud
Browse files

remove unused parameter in date-pipe

parent dcdf3b29
Branches
Tags
No related merge requests found
...@@ -20,14 +20,6 @@ describe('FormatDateWithTimePipe', () => { ...@@ -20,14 +20,6 @@ describe('FormatDateWithTimePipe', () => {
expect(result).toBe('Freitag, 01.01.2021, 0:00:00'); expect(result).toBe('Freitag, 01.01.2021, 0:00:00');
}) })
it('should return in date in format', () => {
const date: Date = new Date('01.01.2021');
const result: string = pipe.transform(date, false);
expect(result).toBe('01.01.2021, 0:00:00');
})
it('should return undefined on null', () => { it('should return undefined on null', () => {
const result: string = pipe.transform(null); const result: string = pipe.transform(null);
......
import { Pipe, PipeTransform } from '@angular/core'; import { Pipe, PipeTransform } from '@angular/core';
import { isNil } from 'lodash-es'; import { isNil } from 'lodash-es';
import { formatWithTime, formatWithTimeAndDay } from '../date.util'; import { formatWithTimeAndDay } from '../date.util';
@Pipe({ name: 'formatDateWithTimePipe' }) @Pipe({ name: 'formatDateWithTimePipe' })
export class FormatDateWithTimePipe implements PipeTransform { export class FormatDateWithTimePipe implements PipeTransform {
transform(date: Date, withDay: boolean = true): string { transform(date: Date): string {
if (isNil(date)) return undefined; if (isNil(date)) return undefined;
return withDay ? formatWithTimeAndDay(date) : formatWithTime(date); return formatWithTimeAndDay(date);
} }
} }
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment