Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
fix: TT-279 Fix the comparison if var is null
  • Loading branch information
jase156 committed Jul 8, 2021
commit d3aaafb5e95396c9599c8c46175b0b8612faea80
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export class SubstractDatePipe implements PipeTransform {

transformInMinutes(fromDate: Date, substractDate: Date): number{

if (fromDate === null || substractDate === null) {
if (!fromDate || !substractDate) {
return 0;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export class CalendarComponent implements OnInit {
map((timeEntriesDatasorce) => timeEntriesDatasorce.data.map(
(timeEntries) => ({
start: new Date(timeEntries.start_date),
end: timeEntries.end_date === null ? null : new Date(timeEntries.end_date),
end: timeEntries.end_date ? new Date(timeEntries.end_date) : null ,
title: timeEntries.description,
id: timeEntries.id,
meta: timeEntries
Expand Down Expand Up @@ -105,7 +105,7 @@ export class CalendarComponent implements OnInit {
}

getTimeWork(startDate: Date, endDate: Date): number{
if (endDate === null){
if (!endDate){
return 30;
}
return new SubstractDatePipe().transformInMinutes( endDate , startDate);
Expand Down