From 8ef466238fabf252f2a3d0c71f7bada4d32add11 Mon Sep 17 00:00:00 2001 From: Ehud Ettun Date: Fri, 24 May 2024 00:31:35 -0400 Subject: [PATCH] dates validation --- .../src/app/search-pairs/search-pairs.component.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/frontend/market-ticker-app/src/app/search-pairs/search-pairs.component.ts b/frontend/market-ticker-app/src/app/search-pairs/search-pairs.component.ts index 3964cfe..164e90c 100644 --- a/frontend/market-ticker-app/src/app/search-pairs/search-pairs.component.ts +++ b/frontend/market-ticker-app/src/app/search-pairs/search-pairs.component.ts @@ -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;