File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
shared/pipes/substract-date
time-entries/components/calendar Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ export class SubstractDatePipe implements PipeTransform {
4444
4545 transformInMinutes ( fromDate : Date , substractDate : Date ) : number {
4646
47- if ( fromDate === null || substractDate === null ) {
47+ if ( ! fromDate || ! substractDate ) {
4848 return 0 ;
4949 }
5050
Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ export class CalendarComponent implements OnInit {
5353 map ( ( timeEntriesDatasorce ) => timeEntriesDatasorce . data . map (
5454 ( timeEntries ) => ( {
5555 start : new Date ( timeEntries . start_date ) ,
56- end : timeEntries . end_date === null ? null : new Date ( timeEntries . end_date ) ,
56+ end : timeEntries . end_date ? new Date ( timeEntries . end_date ) : null ,
5757 title : timeEntries . description ,
5858 id : timeEntries . id ,
5959 meta : timeEntries
@@ -105,7 +105,7 @@ export class CalendarComponent implements OnInit {
105105 }
106106
107107 getTimeWork ( startDate : Date , endDate : Date ) : number {
108- if ( endDate === null ) {
108+ if ( ! endDate ) {
109109 return 30 ;
110110 }
111111 return new SubstractDatePipe ( ) . transformInMinutes ( endDate , startDate ) ;
You can’t perform that action at this time.
0 commit comments