logseq / logseq

A privacy-first, open-source platform for knowledge management and collaboration. Download link: http://github.com/logseq/logseq/releases. roadmap: http://trello.com/b/8txSM12G/roadmap
https://logseq.com
GNU Affero General Public License v3.0
30.26k stars 1.77k forks source link

Support of journal format "yyyy-MM-dd 'w'ww-E" #9542

Open yoghurtdewdew opened 1 year ago

yoghurtdewdew commented 1 year ago

Search first

What Happened?

I set :journal/page-title-format "yyyy-MM-dd 'w'ww-E" in config.edn. Then the journal page went blank.

Reproduce the Bug

I set :journal/page-title-format "yyyy-MM-dd 'w'ww-E" in config.edn (current)

image

Then reset the index.

image

Then the journal page went blank.

image

While, the journals title were right.

image

Before I reset the index, I took a look at the journal page, it showed as "2023-05-31 W21-sun" not "2023-05-31 w21-Sun".

Expected Behavior

To open the journal page with the title format as "2023-05-31 w21-Sun". And to format journal title as "2023-05-31 w21-Sun". p.s. I tried "yyyy-MM-dd 'w'ww-E" turned “sun” not “Sun”. And I would like it to be like “w21” not “W21”.

Screenshots

No response

Desktop or Mobile Platform Information

MacOS 13.3.1 (M1) Logseq desktop 0.9.8

Additional Context

My expection: To open the journal page with the title format as "2023-05-31 w21-Sun". And to format journal title as "2023-05-31 w21-Sun".

Are you willing to submit a PR? If you know how to fix the bug.

yoghurtdewdew commented 1 year ago

And clearing didn't help. The journal page is still blank.

image
yoghurtdewdew commented 1 year ago

And when I open the single journal page in "all pages" (since the "journal" page went blank), I found linked/scheduled things didn't appear.

yoghurtdewdew commented 1 year ago

New bugs

Could not add “day of year” into journal title by adding DDDD, which disabled journal. Re-index, re-start and clearing didn't help. image

Expection

Use :journal/page-title-format "yyyy-MM-dd E ww-DDDD" to show week & day of year at the same time.

And there is a new request

I see "...年...月...日" format, is it possible to show day of week in Chinese like "...年...月...日 周四"?

cnrpman commented 1 year ago

Can you please provide console prints? Also I'm not sure if :journal/page-title-format "yyyy-MM-dd 'w'ww-E" is supported. You need to investigate the codebase. Feel free to contribute code on this.

yoghurtdewdew commented 1 year ago

Hi, would you please give me more information about how to provide the console prints? I nearly know nothing about coding. Here, wwfor week number is used after I found it in moment.js(https://momentjs.com/docs/#/displaying/format/). And I am curious about the codebase about date & time format. Maybe ww is supported, but DDDD and use custom characters is not. I have investigated this in https://docs.logseq.com/ and didn't found the needed information.

cnrpman commented 1 year ago

DevTool: https://help.figma.com/hc/en-us/articles/360041949073-Use-Chrome-Developer-Tools

Logseq is using cljs-time for format parsing: https://github.com/andrewmcveigh/cljs-time/tree/master source: https://github.com/logseq/logseq/blob/17f51c7b77c979add2685e0b656ce15a29dc447e/deps/graph-parser/src/logseq/graph_parser/date_time_util.cljs#L3-L5

Feel free to submit PR to https://github.com/logseq/docs to enrich the information.

yoghurtdewdew commented 1 year ago

Thanks for your help!

I checked https://cljdoc.org/d/com.andrewmcveigh/cljs-time/0.5.2/api/cljs-time.format and think ww may be used for 00~52 week number and DDDD for 001~365 day number.

I am using logseq desktop, devtool is worked for browser. Would you mind testing :journal/page-title-format "yyyy-MM-dd 'w'ww-E" or :journal/page-title-format "yyyy-MM-dd E ww-DDDD" to see if that is supported? If not, week & day number may be a request.

I really expect to see those numbers somewhere in Logseq.

Another thing is, the old journal page reference would not renew after changed the journal title, which maybe break the links or be untidy. So, hope this can work better as the journal title support for more formats.

cnrpman commented 1 year ago

I am using logseq desktop, devtool is worked for browser. Would you mind testing :journal/page-title-format "yyyy-MM-dd 'w'ww-E" or :journal/page-title-format "yyyy-MM-dd E ww-DDDD" to see if that is supported? If not, week & day number may be a request.

I would suggest to test it in cljs-time lib first.

the old journal page reference would not renew after changed the journal title,

https://github.com/logseq/logseq/issues/4279 Basically it's hard to capture all these cases (and hard to implement in code for these remaining ones), but investigation & code contribution are welcome. https://github.com/logseq/logseq/issues/7519

lef-est commented 1 year ago

@yoghurtdewdew

I am using logseq desktop, devtool is worked for browser

devtools work on the desktop clients too, because they're Electron-based.

yoghurtdewdew commented 12 months ago

Sorry, I have learned nothing about programming. I don't know how to test in cljs time lib. I can search and view various documents online, but I really don't know how to test. Including the fact that I have read a lot of tutorials to modify the title format now, you can see that the modifications I am currently hoping for have ended in failure. That's why I said if you are willing to test and see if the problem will recur. If you are unable to use the title format I provided, it indicates that Logseq does not support it. If you find that displaying week&day numbers is supported, you can tell me the correct title format. Instead of telling one that you are not sure, and letting me, who knows nothing about coding, to try something one is unable to use once more. But thanks for your explaination, although it doesn't solve the problem.

yoghurtdewdew commented 12 months ago

I have reviewed issue 4279, so the date link used by the user may be in the format of [[date]] or #date. These date links are linked to the journal. The requirement in this regard is that when updating the journal title format, it can automatically recognize the dates in the [[date]] and #date, and replace them in the date format to keep the double chain valid. Additionally, I agree to include date links in other text or form for easy updates. Errors can be avoided by searching first and then updating, or by asking users to make a secondary determination of the links that will be replaced.

yoghurtdewdew commented 12 months ago

I have reviewed issue 7519 and I believe that it is very important to be able to synchronously modify the names in query when modifying [[name]] and #name. Query is a very important feature. If the links in query cannot be automatically updated, I may never want to use it, as the links will eventually expire. I believe that whether an issue is a bug or a request depends more on logical factors rather than whether it can be implemented. On the other hand, the failure to synchronize updated links makes it impossible to implement previous valid links, which can also indicate that this issue is more of a bug than a request.

cnrpman commented 12 months ago

@yoghurtdewdew Yes, but it's too hard to implement in a text-based storage.

yoghurtdewdew commented 12 months ago

@yoghurtdewdew

I am using logseq desktop, devtool is worked for browser我正在使用logeq桌面,devtool适用于浏览器

devtools work on the desktop clients too, because they're Electron-based.devtools也可以在桌面客户端上运行,因为它们是基于Electron的。

Thank you very much for this. But I'm sorry, I really don't understand how to use devtools on the Logseq desktop. I don't understand programming. If someone could tell me what to download first, how to install it, what to click on first, then what to click on, and then what to copy.etc it would be even better.

cnrpman commented 12 months ago

Thank you very much for this. But I'm sorry, I really don't understand how to use devtools on the Logseq desktop. I don't understand programming. If someone could tell me what to download first, how to install it, what to click on first, then what to click on, and then what to copy.etc it would be even better.

We may backlog this ticket for now.

yoghurtdewdew commented 12 months ago

@yoghurtdewdew Yes, but it's too hard to implement in a text-based storage.是的,但是在基于文本的存储中实现它太难了。

I think Logseq have created amazing smart links, it is possible to retrieve them in a specific format and use certain variables for text replacement, and may before re-index. I understand that caution in this regard, but batch by batch smart search and manually confirmation will be surely better than manual one by one modification or links that can only be invalidated. And after confirmation, the replacement process requires the software's response time to process the text, which is definitely understandable. But if the date links cannot be updated, then what I and others will do is never use the date link again in case of futher invalid links.

yoghurtdewdew commented 12 months ago

Thank you very much for this. But I'm sorry, I really don't understand how to use devtools on the Logseq desktop. I don't understand programming. If someone could tell me what to download first, how to install it, what to click on first, then what to click on, and then what to copy.etc it would be even better.

We may backlog this ticket for now.

Sorry, I have learned nothing about programming. I don't know how to test in cljs time lib. I can search and view various documents online, but I really don't know how to test. Including the fact that I have read a lot of tutorials to modify the title format now, you can see that the modifications I am currently hoping for have ended in failure. That's why I said if you are willing to test and see if the problem will recur. If you are unable to use the title format I provided, it indicates that Logseq does not support it. If you find that displaying week&day numbers is supported, you can tell me the correct title format. Instead of telling one that you are not sure, and letting me, who knows nothing about coding, to try something one is unable to use once more. But thanks for your explaination, although it doesn't solve the problem.

I am very sorry to see that after sending & receiving so many reports & comments, you are still unable to provide me with effective assistance, even it has not be determined what happened to be this problem. It seems that it is futile for someone who does not understand programming to raise an issue here. 💔

cnrpman commented 12 months ago

@yoghurtdewdew Very sorry to hear. Maybe you can find help on the Discord or forum for work-around.

This feature request on the specific date format to support requires engineering effort to investigate. Can't expect that happens so quick given we have 1300 out of 5000 issue tickets open, and some tickets are having much bigger influences on users.

We are preparing a rank board for the issue priorities and hope it would give a better understanding of the engineering resource allocation.

lef-est commented 12 months ago

@yoghurtdewdew

Thank you very much for this. But I'm sorry, I really don't understand how to use devtools on the Logseq desktop. I don't understand programming. If someone could tell me what to download first, how to install it, what to click on first, then what to click on, and then what to copy.etc it would be even better.

The guide on how to use devtools is provided in a previous reply:

Hi, would you please give me more information about how to provide the console prints?

DevTool: https://help.figma.com/hc/en-us/articles/360041949073-Use-Chrome-Developer-Tools

@cnrpman did not ask you to use devtools to fix the problem yourself. he asked you to provide console prints (https://github.com/logseq/logseq/issues/9542#issuecomment-1573373564). in other words, he wanted you to tell him what error would appear in the devtools when your encounter the error so that the developers may fix it.

Can you please provide console prints?

you don't need to understand programming to do this.

yoghurtdewdew commented 12 months ago

@lef-est Hi! Thanks for explaining! But I was really sorry to say that I just failed on the first step with Logseq desktop, ⌘⌥I didn't open Developer Tools, it will only print ……. I am willing to provide console prints if I can. 😞

image
lef-est commented 12 months ago

@yoghurtdewdew No idea why that would happen but the guide mentions the other option: IMG_20230603_223222

also please note that after you have the console open, you need to repeat the steps that would trigger the original error you saw, because only the console logs when the error happens are useful.

yoghurtdewdew commented 12 months ago
image

Okay, I found this in the Menubar, and I will have a try.

yoghurtdewdew commented 12 months ago

This time, when I change format from yyyy-MM-dd EEE to yyyy-MM-dd 'w'ww-E, the journal page didn't go blank, but the format is still show as yyyy-MM-dd EEE not yyyy-MM-dd 'w'ww-E.

Then I check all pages, the journal pages were formatted as yyyy-MM-dd 'w'ww-E.

Then, re-index step. The journal page went blank. Checking all pages found this:

image

Some journal pages named yyyy-MM-dd EEE might be from mobile end and not synced with the desktop end?

The console showed so many Uncaught TypeError, consoles of Uncaught TypeError.zip

And now I have to change format from yyyy-MM-dd 'w'ww-E back to yyyy-MM-dd EEE so I would be able to use journal page.

I am afraid to and didn't test DDDD (day of year) in case to be caught in crashes of Logseq. I surely do not know how to test it in cljs-time lib first as suggested.

And hope yyyy-MM-dd 'w'ww-E or yyyy-MM-dd E ww-DDDD would be able to be used in date format.

If there need more information that I could provide please let me know.

Additionally, sometimes link preview on [[page]] do not work, with null notice showed. I will paste screenshot next time.

cnrpman commented 12 months ago

Some journal pages named yyyy-MM-dd EEE might be from mobile end and not synced with the desktop end?

It requires a careful handling when using 3rd party sync drive like iCloud and changing the format. Ensure the config.edn is synced and the format is changed on ALL devices, then re-index on ALL devices.

The console showed so many Uncaught TypeError,

Seems most Uncaught TypeError are from plugin logseq-tidy-blocks-plugin Mostly caused by unhandled exception in the UX.

Additionally, sometimes link preview on [[page]] do not work, with null notice showed. I will paste screenshot next time.

https://github.com/logseq/logseq/issues/5981 https://github.com/logseq/logseq/issues/5981#issuecomment-1519092729

cnrpman commented 12 months ago
image image image
yoghurtdewdew commented 12 months ago

Additionally, sometimes link preview on [[page]] do not work, with null notice showed. I will paste screenshot next time.

image

Seems most Uncaught TypeError are from plugin logseq-tidy-blocks-plugin

While, this issue may not from the plugin logseq-tidy-blocks-plugin because I found the issue before I use this plugin.

yoghurtdewdew commented 12 months ago

It requires a careful handling when using 3rd party sync drive like iCloud and changing the format. Ensure the config.edn is synced and the format is changed on ALL devices, then re-index on ALL devices.

So how to make sure all the files synced to the desktop when using Logseq mobile? To wait and reopen Logseq desktop after using Logseq mobile? I care the sync not just because the filename, but also could not found the modified version from Logseq mobile, as showed in issue #9552

yoghurtdewdew commented 12 months ago

Here I didn't find an error in the console with that plugin unloaded. But still blank journal after re-index. With strange and messy filenames.

image image image

This time, when I change format from yyyy-MM-dd EEE to yyyy-MM-dd 'w'ww-E, the journal page didn't go blank at first, but the format is still show as yyyy-MM-dd EEE not yyyy-MM-dd 'w'ww-E. Then I check all pages, the journal pages were formatted as yyyy-MM-dd 'w'ww-E. Then, re-index step. The journal page went blank. Checking all pages found this: Some journal pages named yyyy-MM-dd EEE might be from mobile end and not synced with the desktop end? And now I have to change format from yyyy-MM-dd 'w'ww-E to yyyy-MM-dd EEE so I would be able to use journal page. I am afraid to and didn't test DDDD (day of year) in case to be caught in crashes of Logseq. I surely do not know how to test it in cljs-time lib first as suggested. And hope yyyy-MM-dd 'w'ww-E or yyyy-MM-dd E ww-DDDD would be able to be used in date format.

lef-est commented 12 months ago

@yoghurtdewdew some tips on using github issues:

  1. please do not discuss multiple unrelated problems in one issue.
  2. please do not open a new issue if the problem is already reported in previous issues.
  3. in this case, as the developer already mentioned that the "null" preview problem is reported in #5981 , please continue the discussion about this specific problem over there in that issue instead of talking about it here like https://github.com/logseq/logseq/issues/9542#issuecomment-1575482279. ; similarly, as the "journals rename problem" is already reported in https://github.com/logseq/logseq/issues/4279 as the developer has already told you, please direct discussion about this to that issue instead of mixing everything here.
  4. please refrain from posting unnecessary information such as https://github.com/logseq/logseq/issues/9542#issuecomment-1575367566 because on github, every single reply will be sent to the inbox of everyone who participates in the issue — that includes the developers, and as there are 1.3k issues in this repository, if every issue sends multiple notifications a day with information like this, it will be impossible for developers to track issues or respond to questions when there are ~10k notifications in his inbox.
  5. as such, please also do not use github as a channel for asking non-bug questions about how to use the software such as "how to fetch NOW from non-journals". There is an official forum (discuss.logseq.com) for that where you can ask as many questions you want, and there are query gurus on the forum that can answer questions like these.
yoghurtdewdew commented 12 months ago
lef-est commented 12 months ago

@yoghurtdewdew

journal page went blank after setting journal/page-title-format as "yyyy-MM-dd 'w'ww-E". That's weird, right?

yep. it may not be a supported date format, but logseq shouldn't just "go blank" when it receives unexpected values.

I am very sorry that I tried for hours to only find no information that was useful to provide to you from the console.

thanks for your investigation, understanding and patience too. you've provided what you can. sorry i can't be of much help either. i'm not a developer, i just chimed in to explain what console logs meant and hopefully make this issue a bit more organized.

cnrpman commented 12 months ago

but also could not found the modified version from Logseq mobile, as showed in issue

Yes, data integrity on iCloud is not ensured as I replied in https://github.com/logseq/logseq/issues/9552#issuecomment-1575620471 Reference: https://discuss.logseq.com/t/im-using-logseq-with-icloud-but-experiencing-data-loss-or-file-conflict-errors-whats-going-on/13393

cnrpman commented 12 months ago

Additionally, sometimes link preview on [[page]] do not work, with null notice showed. I will paste screenshot next time. image Seems most Uncaught TypeError are from plugin logseq-tidy-blocks-plugin While, this issue may not from the plugin logseq-tidy-blocks-plugin because I found the issue before I use this plugin.

Hey, the tooltip Null and the Uncaught TypeError isn't a same thing. I think the tooltip Null is a reported issue. See the links in my reply https://github.com/logseq/logseq/issues/9542#issuecomment-1575462193

5981

https://github.com/logseq/logseq/issues/5981#issuecomment-1519092729