diff --git a/packages/desktop-client/src/components/common/Select.tsx b/packages/desktop-client/src/components/common/Select.tsx index d60bd41000f..eb2be0fbaaf 100644 --- a/packages/desktop-client/src/components/common/Select.tsx +++ b/packages/desktop-client/src/components/common/Select.tsx @@ -19,6 +19,7 @@ type SelectProps = { style?: CSSProperties; wrapperStyle?: CSSProperties; line?: number; + disabled?: boolean; disabledKeys?: Value[]; }; @@ -46,6 +47,7 @@ export default function Select({ style, wrapperStyle, line, + disabled, disabledKeys = [], }: SelectProps) { const arrowSize = 7; @@ -55,6 +57,7 @@ export default function Select({ ({ case 'date': if (value) { if (value.frequency) { - return getRecurringDescription(value); + return getRecurringDescription(value, dateFormat); } return formatDate(parseISO(value), dateFormat); } diff --git a/packages/desktop-client/src/components/schedules/DiscoverSchedules.tsx b/packages/desktop-client/src/components/schedules/DiscoverSchedules.tsx index 74a9f2646d6..713397ed29b 100644 --- a/packages/desktop-client/src/components/schedules/DiscoverSchedules.tsx +++ b/packages/desktop-client/src/components/schedules/DiscoverSchedules.tsx @@ -1,4 +1,5 @@ import React, { useState } from 'react'; +import { useSelector } from 'react-redux'; import q, { runQuery } from 'loot-core/src/client/query-helpers'; import { send } from 'loot-core/src/platform/client/fetch'; @@ -35,11 +36,14 @@ function DiscoverSchedulesTable({ }) { const selectedItems = useSelectedItems(); const dispatchSelected = useSelectedDispatch(); + const dateFormat = useSelector( + state => state.prefs.local.dateFormat || 'MM/dd/yyyy', + ); function renderItem({ item }: { item: DiscoverScheduleEntity }) { const selected = selectedItems.has(item.id); const amountOp = item._conditions.find(c => c.field === 'amount').op; - const recurDescription = getRecurringDescription(item.date); + const recurDescription = getRecurringDescription(item.date, dateFormat); return ( -
- +
+ + updateField('endOccurrences', e.target.value)} + defaultValue={config.endOccurrences || 1} + /> + occurrence{config.endOccurrences === '1' ? '' : 's'} + + )} + {config.endMode === 'on_date' && ( + updateField('endDate', value)} + containerProps={{ style: { width: 100 } }} + dateFormat={dateFormat} + /> + )}
Repeat every updateField('interval', e.target.value)} - onEnter={e => updateField('interval', e.target.value)} + type="number" + min={1} + onChange={e => updateField('interval', e.target.value)} defaultValue={config.interval || 1} />