Skip to content

Commit

Permalink
dates validation
Browse files Browse the repository at this point in the history
  • Loading branch information
ehudettun committed May 24, 2024
1 parent 5e4731a commit 8ef4662
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ export class SearchPairsComponent {
return;
}

if (new Date(this.startDate) > new Date(this.endDate)) {
this.errorMessage = 'Start date must be before end date.';
return;
}

if (!this.ticker1Valid || !this.ticker2Valid) {
this.errorMessage = 'One or both tickers are invalid.';
return;
Expand Down

0 comments on commit 8ef4662

Please sign in to comment.