Skip to content
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

zk cli cannot search note modified or created at the same time #404

Closed
1 of 2 tasks
dtanphat9388 opened this issue Apr 20, 2024 · 4 comments
Closed
1 of 2 tasks

zk cli cannot search note modified or created at the same time #404

dtanphat9388 opened this issue Apr 20, 2024 · 4 comments

Comments

@dtanphat9388
Copy link

dtanphat9388 commented Apr 20, 2024

Check if applicable

  • I have searched the existing issues (required)
  • I'm willing to help fix the problem and contribute a pull request

Describe the bug

I created 2 new note in yesterday and modified 3 other notes in today. I expected:
zk list --created return 2 results
zk list --modified return 3 results
zk list --created "yesterday" --modified "today" return 5 results

How to reproduce?

# return 2 note as expected
zk list --created="yesterday" -P -f "oneline"
# return 3 note as expected
zk list --modified="today" -P -f "oneline"

# but this filter return 0 result 
zk list --modified="today" --created="yesterday" -P -f "oneline"

zk configuration

[note]
filename = "{{id}}"
template = "default.md"
ignore = [
   "drafts/*",
]
[format.markdown]

hashtags = true
colon-tags = false
multiword-tags = true


toml
[lsp]
[lsp.diagnostics]
dead-link = "error"
[lsp.completion]
[filter]
[alias]
conf = '$EDITOR "$ZK_NOTEBOOK_DIR/tech/.zk/config.toml"'


### Environment

```bash
zk 0.14.0
system: Linux 6.5.0-27-generic x86_64 GNU/Linux
@tjex
Copy link
Member

tjex commented Apr 24, 2024

I can't reproduce this. Are you using YAML dates? Or are you relying on the file dates?

Have you run zk index before these commands just to be sure?

On my end (text grabbed directly from my terminal):

~/.local/src/zk-org/workbench/test-vault main*
sys > zk list --created="yesterday" -P -f "oneline"
star book star-book.md (yesterday)

Found 1 note

~/.local/src/zk-org/workbench/test-vault main*
sys > zk list --modified="today" -P -f "oneline"
another "test" note another "test" note.md (1 month ago)
star book star-book.md (yesterday)

Found 2 notes

~/.local/src/zk-org/workbench/test-vault main*
sys > zk list --modified="today" --created="yesterday" -P -f "oneline"
star book star-book.md (yesterday)

Found 1 note

@tjex tjex added the can't reproduce The bug can't be reproduced by one or more maintainers label Apr 24, 2024
@tjex
Copy link
Member

tjex commented Apr 24, 2024

ahhh, yep. This is because of the day range parsing bug we came across previously: #384

I installed from brew and I get the same results as you.

We've addressed this, but haven't released a new version to package repositories yet.
In the meantime, you can build from source (main branch) if you like.

I'll close for now. If you do build from source and find the issue persists, ping us back here 👍

@tjex tjex removed the can't reproduce The bug can't be reproduced by one or more maintainers label Apr 24, 2024
@tjex tjex closed this as completed Apr 24, 2024
@dtanphat9388
Copy link
Author

Have you run zk index before these commands just to be sure?

i sure, i create auto_command to run ZkIndex after write buffer

		vim.api.nvim_create_autocmd("BufwritePost", {
			pattern = vim.env.ZK_NOTEBOOK_DIR .. "/**/*.md",
			command = "ZkIndex",
		})

I hope this issue is fixed in a later release. Thank you so much.

@tjex
Copy link
Member

tjex commented Apr 27, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants