Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot query block property if it's a date (journal page) #7083

Closed
DimitryDushkin opened this issue Oct 22, 2022 · 2 comments
Closed

Cannot query block property if it's a date (journal page) #7083

DimitryDushkin opened this issue Oct 22, 2022 · 2 comments
Labels
query :type/question Not bug, closed at will. Frequently asked ones would be collected in Logseq Forum's FAQ section.

Comments

@DimitryDushkin
Copy link

DimitryDushkin commented Oct 22, 2022

What happened?

Seems like if block's property is a date it cannot be queried.

Reproduce the Bug

  1. Data:
- DONE completed today
  completed:: [[Oct 22nd, 2022]]
- DONE completed yesterday
  completed:: [[Oct 21st, 2022]]
- DONE completed 10 days ago
  completed:: [[Oct 12th, 2022]]
  1. Query (assume today is Oct 22nd)
#+BEGIN_QUERY
  {
    :title "Tasks completed yesterday"
    :query [
        :find (pull ?b [*])
        :where
            [?b :block/properties ?properties]
            [(get ?properties :completed) ?completed]
            [(< ?completed :today)]
    ]
  }
  #+END_QUERY

It should return 2 tasks (older than today), but returns all of them.

I've tried to use date format like <2022-10-10> (like SCHEDULED property) both in blocks and a query it also doesn't work.

Expected Behavior

It should return 2 tasks (older than today)

Screenshots

No response

Desktop Platform Information

Latest MacOS, Logseq 0.8.9

Mobile Platform Information

No response

Additional Context

Also queries doesn't work at all in iOS app, but that's an another story.

@logseq-cldwalker logseq-cldwalker changed the title Cannot query block property if it's a date Cannot query block property if it's a date (journal page) Oct 24, 2022
@logseq-cldwalker logseq-cldwalker added :type/enhancement Enhancement to product. Does not affect the overall basic use. query :type/question Not bug, closed at will. Frequently asked ones would be collected in Logseq Forum's FAQ section. and removed :type/enhancement Enhancement to product. Does not affect the overall basic use. labels Oct 24, 2022
@logseq-cldwalker
Copy link
Collaborator

Hi. :today should be passed in :inputs. See https://www.reddit.com/r/logseq/comments/y8zgu3/how_to_query_block_property_with_date_between/ for a similar question. See https://docs.logseq.com/#/page/Advanced%20Queries for more example queries. Better place to ask this question would be in #queries discord channel

@logseq-cldwalker logseq-cldwalker added the awaiting-response Issue will be closed if a reply is not received label Oct 27, 2022
@DimitryDushkin
Copy link
Author

DimitryDushkin commented Oct 27, 2022

Hi. :today should be passed in :inputs. See https://www.reddit.com/r/logseq/comments/y8zgu3/how_to_query_block_property_with_date_between/ for a similar question. See https://docs.logseq.com/#/page/Advanced%20Queries for more example queries. Better place to ask this question would be in #queries discord channel

Hey! That's mine question on reddit (I've updated the post to avoid confusion now) :) And passing it to inputs doesn't work. I mistakenly though it worked since it returned all tasks, but as I said in this issue no matter what dates I pass to the query it always returns all blocks.

And I was asking questions in other channels in Discord, but never got answers, so didn't try this time.

@logseq-cldwalker logseq-cldwalker removed the awaiting-response Issue will be closed if a reply is not received label Oct 27, 2022
@logseq logseq locked and limited conversation to collaborators Dec 26, 2022
@Bad3r Bad3r converted this issue into discussion #8069 Dec 26, 2022

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
query :type/question Not bug, closed at will. Frequently asked ones would be collected in Logseq Forum's FAQ section.
Projects
None yet
Development

No branches or pull requests

2 participants