mirror of
https://github.com/usememos/memos.git
synced 2024-11-15 11:17:58 +08:00
fix: use UTC date for calendar filter (#4046)
This commit is contained in:
parent
7e48d13834
commit
2851f11302
1 changed files with 3 additions and 1 deletions
|
@ -34,7 +34,9 @@ const Home = () => {
|
||||||
} else if (filter.factor === "property.hasCode") {
|
} else if (filter.factor === "property.hasCode") {
|
||||||
filters.push(`has_code == true`);
|
filters.push(`has_code == true`);
|
||||||
} else if (filter.factor === "displayTime") {
|
} else if (filter.factor === "displayTime") {
|
||||||
const timestampAfter = new Date(filter.value).getTime() / 1000;
|
const filterDate = new Date(filter.value);
|
||||||
|
const filterUtcTimestamp = filterDate.getTime() + filterDate.getTimezoneOffset() * 60 * 1000;
|
||||||
|
const timestampAfter = filterUtcTimestamp / 1000;
|
||||||
filters.push(`display_time_after == ${timestampAfter}`);
|
filters.push(`display_time_after == ${timestampAfter}`);
|
||||||
filters.push(`display_time_before == ${timestampAfter + 60 * 60 * 24}`);
|
filters.push(`display_time_before == ${timestampAfter + 60 * 60 * 24}`);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue