Repository navigation
fix(repeat): step Deadline and Scheduled in the local calendar - #13615
Merged
tiensonqin merged 1 commit intoOct 7, 2026
Merged
Conversation
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Oct 6, 2026
tiensonqin
approved these changes
Oct 7, 2026
A date picked without a time is local midnight. get-next-time added months and years in UTC, so east of UTC local midnight of March 1 (Feb 28 in UTC) came back as March 29 local, at the end of the same month (db-test logseq#1355). Instants now step in the local calendar; :date properties keep stepping whole UTC days. Tests: new local-calendar cases; the month-end tests use local times as the date picker stores them; day and week counts are local calendar days from a fixed now.
tiensonqin
force-pushed
the
fix/repeat-local-calendar
branch
from
October 7, 2026 12:05
6b22a44 to
0c8d333
Compare
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Oct 8, 2026
devin-ai-integration Bot
pushed a commit
that referenced
this pull request
Oct 8, 2026
A date picked without a time is local midnight. get-next-time added months and years in UTC, so east of UTC local midnight of March 1 (Feb 28 in UTC) came back as March 29 local, at the end of the same month (db-test #1355). Instants now step in the local calendar; :date properties keep stepping whole UTC days. Tests: new local-calendar cases; the month-end tests use local times as the date picker stores them; day and week counts are local calendar days from a fixed now.
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Oct 11, 2026
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Oct 11, 2026
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Oct 13, 2026
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Oct 13, 2026
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Oct 16, 2026
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Oct 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes logseq/db-test#1355.
In a time zone east of UTC (Europe/Berlin, Asia/Tokyo), a task with Deadline March 1, 2026 (no time) repeating every 1 month comes back with Deadline March 29, 2026 instead of April 1. More cases from the issue: yearly from 2027-03-01 gives 2028-02-29;
+every 3 months from 2026-08-31 gives 2026-12-01 at UTC+14;.+monthly completed 2026-04-30 17:00 in Los Angeles gives 2026-05-31 17:00.Deadline and Scheduled store an instant, and a date picked without a time is local midnight.
get-next-timeinsrc/main/frontend/worker/commands.cljsturned it into a UTC date-time (tc/to-date-time) and added months and years in the UTC calendar. East of UTC, local midnight of March 1 is February 28 in UTC; 1 month later is March 28 UTC, which is local March 29.get-next-timenow steps an instant in the local calendar (agoog.date.DateTimeat the same instant), so local midnight of the 1st stays local midnight of the 1st, and a value with a time keeps its local time across a clock change. A:dateproperty keeps the UTC-day stepping it already has (it passeslocal? false).Tests in
src/test/frontend/worker/commands_test.cljs:repeated-instant-steps-in-the-local-calendar-test: the cases above, plus weekly and hourly. On master it fails 3 times in Europe/Berlin, Asia/Tokyo and America/New_York; with the change it passes.double-plus-month-end-keeps-its-day-testandrepeated-task-monthly-deadline-from-31st-testwrote their dates as UTC times (t/date-time); they now use local times (t/local-date-time), as the date picker stores them. With UTC times, January 31 UTC is January 30 local west of UTC, and the old tests passed only in UTC.get-next-timetests used fixed 24-hour days, and their "now" was the real current time; they now count local calendar days (local-days) from a fixed mid-June "now", away from clock changes.frontend.worker.commands-testpasses with TZ set to Europe/Berlin, Asia/Tokyo, Pacific/Kiritimati, America/New_York, America/Los_Angeles, Australia/Sydney, America/Santiago, Etc/GMT+12 and UTC.frontend.components.property.value-test,frontend.worker.handler.property-testandfrontend.worker.pipeline-testpass in Europe/Berlin and America/New_York.