We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 25844d6 commit 405fe0eCopy full SHA for 405fe0e
apps/server/src/routes/api/edited-notes.ts
@@ -182,8 +182,8 @@ export function dateNoteLabelKeywordToDateFilter(dateStr: string): DateFilter {
182
}
183
184
function isValidDatePrefix(dateStr: string): boolean {
185
- // Check if it starts with YYYY format
186
- if (/^\d{4}/.test(dateStr)) {
+ // Check if it starts with YYYY format and only contains numbers and dashes afterwards
+ if (/^\d{4}[-\d]*$/.test(dateStr)) {
187
const year = parseInt(dateStr.substring(0, 4));
188
return !isNaN(year) && year > 0 && year < 10000;
189
0 commit comments