chore: Review fix
This commit is contained in:
@@ -359,7 +359,7 @@ export const generateDateSuggestions = (
|
||||
const exact = directParse || parseDateFromText(englishInput, referenceDate);
|
||||
if (exact) {
|
||||
seen.add(exact.unix);
|
||||
results.push({ label: normalized, ...exact });
|
||||
results.push({ label: normalized, query: englishInput, ...exact });
|
||||
}
|
||||
|
||||
buildSuggestionCandidates(englishInput).some(candidate => {
|
||||
@@ -371,7 +371,7 @@ export const generateDateSuggestions = (
|
||||
!useEnglish && pairs.length
|
||||
? reverseTokens(candidate, pairs)
|
||||
: candidate;
|
||||
results.push({ label, ...result });
|
||||
results.push({ label, query: candidate, ...result });
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
@@ -13,7 +13,10 @@ import {
|
||||
setSeconds,
|
||||
} from 'date-fns';
|
||||
import wootConstants from 'dashboard/constants/globals';
|
||||
import { generateDateSuggestions } from 'dashboard/helper/snoozeDateParser';
|
||||
import {
|
||||
generateDateSuggestions,
|
||||
parseDateFromText,
|
||||
} from 'dashboard/helper/snoozeDateParser';
|
||||
|
||||
const SNOOZE_OPTIONS = wootConstants.SNOOZE_OPTIONS;
|
||||
|
||||
@@ -98,8 +101,10 @@ export const generateSnoozeSuggestions = (
|
||||
return suggestions.map(s => ({
|
||||
date: s.date,
|
||||
unixTime: s.unix,
|
||||
query: s.query,
|
||||
label: capitalizeLabel(s.label),
|
||||
formattedDate: formatSnoozeDate(s.date, currentDate, locale),
|
||||
resolve: () => parseDateFromText(s.query)?.unix ?? s.unix,
|
||||
}));
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user