Plugin API: `logseq.Editor.createJournalPage("YYYY-MM-DD")` creates the previous day's journal west of UTC
Una pull request collegata è già stata integrata.
- #13597 di @tiensonqin — integrata
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 78/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- clojure, javascript
- Ambito
- api
Direzione di ricerca
Parti da create_journal_page in src/main/logseq/api/editor.cljs (righe 164-170), dove (js/Date. date) trasforma una stringa di sola data in mezzanotte UTC e il giorno viene poi letto dai campi locali; leggi gli helper gdate/date-time-util che chiama prima di modificare. Decidi se normalizzare una stringa YYYY-MM-DD nuda a mezzanotte locale in questa funzione o in un helper di data condiviso, e controlla le altre API dell'editor e il #1295 correlato per lo stesso pattern. Fatto significa che la chiamata del plugin restituisce la pagina di diario indicata nella stringa in una zona UTC negativa, ad es. sotto America/Chicago.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Search first
- I searched and no similar issues were found
What Happened?
In a time zone west of UTC, logseq.Editor.createJournalPage("2026-12-01") creates (or returns) the journal page of the day before: "Nov 30th, 2026".
The SDK types the argument as string | Date, and a date-only string is the natural thing to pass. Seen in a plugin (@logseq/libs 0.3.4) in a DB graph, time zone UTC−5.
These inputs gave the intended day:
"2026-12-03T12:00:00"(a local date-time string)- a
Datebuilt from local fields - the local-midnight timestamp in ms
Reproduce the Bug
- Set the computer's time zone west of UTC (e.g. America/Chicago).
- Open a DB graph, and from a plugin run:
const page = await logseq.Editor.createJournalPage("2026-12-01") console.log(page) - The returned page is "Nov 30th, 2026".
Expected Behavior
The journal page of the day in the string: "Dec 1st, 2026", in every time zone.
Screenshots
No response
Files
No response
Browser, Desktop or Mobile Platform Information
macOS 26.6.2 (arm64), Logseq-DB.app 2.0.1, a local build of logseq/logseq 8ffbb22093 (built 2026-10-01), @logseq/libs 0.3.4, time zone America/Chicago (UTC−5). Seen in the app on 2026-10-04.
Additional Context
Investigation (at 8ffbb22093; the function is the same on master 22a29b30de)
-
Where:
src/main/logseq/api/editor.cljs:164-170 @ 8ffbb22093,create_journal_page:(let [date (js/Date. date)] ... (-> (gdate/Date. date) (date-time-util/format "yyyy-MM-dd")) ...) -
Why it fails (confirmed for the JavaScript part, by running it under three zones):
new Date("2026-12-01")is midnight UTC, as ECMAScript defines for a date-only string, and the day is then read back from the local fields. West of UTC that is the evening of Nov 30. A string with a time and no offset is parsed as local time, which is why"2026-12-03T12:00:00"works.TZ "2026-12-01"→ local day"2026-12-01T12:00:00"→ local dayAmerica/Chicago 2026-11-30 2026-12-01 UTC 2026-12-01 2026-12-01 Asia/Tokyo 2026-12-01 2026-12-01 So zones at or east of UTC are not affected.
-
Workaround in use: pass local noon,
"YYYY-MM-DDT12:00:00". -
Related: #1295 (a date-only Deadline / Scheduled changing day across zones; a different code path, the same class of day ↔ instant conversion).
Are you willing to submit a PR? If you know how to fix the bug.
- I'm willing to submit a PR (Thank you!)
- Lingua principale
- Nessun dato sulla lingua
- Stelle
- 28
- Fork
- 2
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di logseq/db-test
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Table filter "does not contain" is case-sensitive while "contains" is notForse già presa @tiensonqin l’ha presa 11 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
Sorting a tag table by a checkbox gives the same order ascending and descendingForse già presa @tiensonqin l’ha presa 11 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
Potential Dataloss: Deleting an entry from the property page's node table has no confirmation dialogForse già presa @tiensonqin l’ha presa 14 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
Tutte le issue di logseq/db-test
Issue simili
-
First unknown-user login after boot is one scrypt run slower than a real user's wrong passwordApertaarea: backend bug priority: low
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
snapotter-hq/SnapOtter#2254 ·
I maintainer di solito rispondono entro 1 giorno
-
[Chore] Remove dead AutogenV2 feature flagForse già presa @geeknishantkyeus l’ha presa oggi. Apertabug triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
kyverno/kyverno#17936 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
Deepak3699/Ai_Mentor#244 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement model:sonnet phase-2-optimize runtime:claude security size:S
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
FootprintAI/Containarium#2416 ·
I maintainer di solito rispondono entro 1 giorno
-
bug ticket
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
cratestack/cratestack#1153 ·
I maintainer di solito rispondono entro 1 giorno