Feed: cap date range inputs at today to prevent selecting future dates
This commit is contained in:
@@ -44,6 +44,7 @@
|
|||||||
let dateTo = '';
|
let dateTo = '';
|
||||||
let customFrom = '';
|
let customFrom = '';
|
||||||
let customTo = '';
|
let customTo = '';
|
||||||
|
const today = new Date().toISOString().slice(0, 10);
|
||||||
let query = '';
|
let query = '';
|
||||||
let shown = PAGE_SIZE;
|
let shown = PAGE_SIZE;
|
||||||
let loading = true;
|
let loading = true;
|
||||||
@@ -236,6 +237,7 @@
|
|||||||
<input
|
<input
|
||||||
type="date"
|
type="date"
|
||||||
bind:value={customFrom}
|
bind:value={customFrom}
|
||||||
|
max={today}
|
||||||
on:change={() => { datePre = 'all'; }}
|
on:change={() => { datePre = 'all'; }}
|
||||||
class="bg-transparent text-white text-sm focus:outline-none [color-scheme:dark]"
|
class="bg-transparent text-white text-sm focus:outline-none [color-scheme:dark]"
|
||||||
/>
|
/>
|
||||||
@@ -245,6 +247,7 @@
|
|||||||
<input
|
<input
|
||||||
type="date"
|
type="date"
|
||||||
bind:value={customTo}
|
bind:value={customTo}
|
||||||
|
max={today}
|
||||||
on:change={() => { datePre = 'all'; }}
|
on:change={() => { datePre = 'all'; }}
|
||||||
class="bg-transparent text-white text-sm focus:outline-none [color-scheme:dark]"
|
class="bg-transparent text-white text-sm focus:outline-none [color-scheme:dark]"
|
||||||
/>
|
/>
|
||||||
|
|||||||
Reference in New Issue
Block a user