mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-07-20 23:21:06 +02:00
Merge pull request #371 from samkul-swe/feature/date-connector-fix
[Fix] Not disabling any dates for connectors when indexing
This commit is contained in:
commit
499c09d2c9
1 changed files with 0 additions and 24 deletions
|
|
@ -141,28 +141,6 @@ export default function ConnectorsPage() {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const getDisabledEndDates = (date: Date) => {
|
|
||||||
const connector = connectors.find((c) => c.id === selectedConnectorForIndexing);
|
|
||||||
|
|
||||||
switch (connector?.connector_type) {
|
|
||||||
case EnumConnectorName.GOOGLE_CALENDAR_CONNECTOR:
|
|
||||||
return startDate ? date < startDate : false;
|
|
||||||
default:
|
|
||||||
return date > today || (startDate ? date < startDate : false);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const getDisabledStartDates = (date: Date) => {
|
|
||||||
const connector = connectors.find((c) => c.id === selectedConnectorForIndexing);
|
|
||||||
|
|
||||||
switch (connector?.connector_type) {
|
|
||||||
case EnumConnectorName.GOOGLE_CALENDAR_CONNECTOR:
|
|
||||||
return endDate ? date > endDate : false;
|
|
||||||
default:
|
|
||||||
return date > today || (endDate ? date > endDate : false);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="container mx-auto py-8 max-w-6xl">
|
<div className="container mx-auto py-8 max-w-6xl">
|
||||||
<motion.div
|
<motion.div
|
||||||
|
|
@ -366,7 +344,6 @@ export default function ConnectorsPage() {
|
||||||
mode="single"
|
mode="single"
|
||||||
selected={startDate}
|
selected={startDate}
|
||||||
onSelect={setStartDate}
|
onSelect={setStartDate}
|
||||||
disabled={getDisabledStartDates}
|
|
||||||
initialFocus
|
initialFocus
|
||||||
/>
|
/>
|
||||||
</PopoverContent>
|
</PopoverContent>
|
||||||
|
|
@ -393,7 +370,6 @@ export default function ConnectorsPage() {
|
||||||
mode="single"
|
mode="single"
|
||||||
selected={endDate}
|
selected={endDate}
|
||||||
onSelect={setEndDate}
|
onSelect={setEndDate}
|
||||||
disabled={getDisabledEndDates}
|
|
||||||
initialFocus
|
initialFocus
|
||||||
/>
|
/>
|
||||||
</PopoverContent>
|
</PopoverContent>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue