mirror of
https://github.com/mjl-/mox.git
synced 2025-06-28 02:28:15 +03:00
webmail: fix parsing search filter "start:<date>" and "end:<date>"
we were only properly parsing values of "<date>T<time>" or just "<time>". so you could select a date in the form (or type it), but it would be treated as just a word of text to search for in messages. so it would quietly do the wrong thing.
This commit is contained in:
parent
ef77f58e08
commit
091faa8048
@ -1866,8 +1866,9 @@ const parseSearchDateTime = (s, isstart) => {
|
||||
return d ? d.toJSON() : undefined;
|
||||
}
|
||||
else if (t.length === 1) {
|
||||
if (isNaN(Date.parse(fixDate(t[0])))) {
|
||||
const d = new Date(fixDate(t[0]));
|
||||
const fds = fixDate(t[0]);
|
||||
if (!isNaN(Date.parse(fds))) {
|
||||
const d = new Date(fds);
|
||||
if (!isstart) {
|
||||
d.setDate(d.getDate() + 1);
|
||||
}
|
||||
|
@ -486,8 +486,9 @@ const parseSearchDateTime = (s: string, isstart: boolean): string | undefined =>
|
||||
const d = new Date(fixDate(t[0]) + 'T'+t[1])
|
||||
return d ? d.toJSON() : undefined
|
||||
} else if (t.length === 1) {
|
||||
if (isNaN(Date.parse(fixDate(t[0])))) {
|
||||
const d = new Date(fixDate(t[0]))
|
||||
const fds = fixDate(t[0])
|
||||
if (!isNaN(Date.parse(fds))) {
|
||||
const d = new Date(fds)
|
||||
if (!isstart) {
|
||||
d.setDate(d.getDate()+1)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user