feat: set default dates for backtest (yesterday to 30 days ago)

This commit is contained in:
shokollm
2026-04-10 10:23:35 +00:00
parent 0f558a5e8e
commit 3a7d3a3732

View File

@@ -16,6 +16,15 @@
let selectedBacktest = $state<Backtest | null>(null);
onMount(async () => {
// Set default dates (yesterday to 30 days ago)
const yesterday = new Date();
yesterday.setDate(yesterday.getDate() - 1);
const thirtyDaysAgo = new Date();
thirtyDaysAgo.setDate(thirtyDaysAgo.getDate() - 30);
endDate = yesterday.toISOString().split('T')[0];
startDate = thirtyDaysAgo.toISOString().split('T')[0];
if (!$isAuthenticated && !$isLoading) {
goto('/login');
return;