mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-27 13:26:58 -05:00
feat: Implement timezone-independent date picker
This commit is contained in:
@@ -233,16 +233,17 @@ export default function Rides() {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Opening date filter
|
||||
// Opening date filter (timezone-independent string comparison)
|
||||
if (filters.openingDateFrom || filters.openingDateTo) {
|
||||
if (!ride.opening_date) {
|
||||
return false;
|
||||
}
|
||||
const openingDate = new Date(ride.opening_date);
|
||||
if (filters.openingDateFrom && openingDate < filters.openingDateFrom) {
|
||||
|
||||
// Direct YYYY-MM-DD string comparison (lexicographically correct)
|
||||
if (filters.openingDateFrom && ride.opening_date < filters.openingDateFrom) {
|
||||
return false;
|
||||
}
|
||||
if (filters.openingDateTo && openingDate > filters.openingDateTo) {
|
||||
if (filters.openingDateTo && ride.opening_date > filters.openingDateTo) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user