logseq icon indicating copy to clipboard operation
logseq copied to clipboard

When changing between date formats backlinks to journal pages aren't valid anymore and pages with dates are created

Open defaulvlan opened this issue 3 years ago • 4 comments

What happened?

(Info: this issue might relate to https://github.com/logseq/logseq/issues/6377 )

When you have the date format EEEE, yyyy/MM/dd pages like Friday, 2022 or Saturday, 2022/09 are generated when you create a journal page. (weird, but journal pages still working at this point)

When you change the date format to something else like yyyy-MM-dd all backlinks to journals aren't valid anymore.

(additional info: In my personal graph with EEEE, yyyy/MM/dd I currently can't re-import the graph if I delete \AppData\Roaming\Logseq - not all, but some journal pages missing, although the markdown data is in journals folder.)

Reproduce the Bug

  1. Create a new graph
  2. Set date format to EEEE, yyyy/MM/dd
  3. Re-Index
  4. Create a page and link to one or more date with native logseq functions like /today or /date
  5. Visit links with date
  6. look at All pages there are journal structured pages there (not intended, right?)
  7. Change date format to yyyy-MM-dd
  8. Re-Index
  9. Previously created "date links" to journal go to "normal" pages and aren't linked to the journal anymore

Expected Behavior

  • No auto generated pages like this: image if you interact with them they get written to the pages folder image

  • Links to journals should work, although you change date format

  • I'd expect logseq would recognize every format it offers in Editor -> Preferred file format

Screenshots

https://user-images.githubusercontent.com/106736889/188286493-b0d16195-0a61-49f2-9ebe-e4f28aa1c40b.mp4

Desktop Platform Information

Windows 11 any build Logseq 0.8.4

Mobile Platform Information

not tested

Additional Context

No response

defaulvlan avatar Sep 03 '22 20:09 defaulvlan

I don't know if it aligns with your design principles for logseq, but maybe it's an option to save the date in a standardized format like ISO 8601 to disk and render it differently in the frontend based on user selection.

defaulvlan avatar Sep 03 '22 20:09 defaulvlan

@defaulvlan Yes, the original dates will be invalid for now. It's not related to #6377

Using unified format to store sounds good to me. I'm happy to review any PR on this.

cnrpman avatar Sep 05 '22 08:09 cnrpman

Thanks for the info. I just wanted to add that for me this is also a data stability issue.

Because for my one graph where I changed the date format to EEEE, yyyy/MM/dd a few month ago I cannot successfully reindex without losing journal entries. (with losing I mean the markdown files are there, but data is not visible in Logseq)

Only the data in \AppData\Roaming\Logseq keeps it working currently. If I transfer my logseq data directory (markdown, settings etc.) to a fresh Windows install I cannot get the current state back.

itsamemarkus avatar Sep 18 '22 08:09 itsamemarkus

@itsamemarkus Is this happening on the latest version?

cnrpman avatar Sep 19 '22 02:09 cnrpman