Skip to content

Conversation

jakebox
Copy link

@jakebox jakebox commented Sep 15, 2025

Thanks for all the hard work on taskwarrior-tui!

I thought it would be nice if tw-tui supported taskwarrior's report._.dateformat option. This PR reads this configuration parameter and uses it when formatting the due task property.

The only slight complexity in implementation is converting from Taskwarrior's date formatting to chrono date format. I want to spend a little more time cleaning this up, but wanted to post this draft PR to see if this is an acceptable feature to add.

-jacob

@jakebox
Copy link
Author

jakebox commented Sep 17, 2025

@kdheepak Sorry, should have tagged you on this draft.

@kdheepak
Copy link
Owner

I think this is great! Thanks for implementing a draft, I'd be open to adding this feature. My first thought is I'm not sure if all taskwarrior dateformats can be converted to chrono. If we can get a fallback for when that happens that would be good enough I think.

@jakebox
Copy link
Author

jakebox commented Sep 17, 2025

Thank you! I'll work on polishing it up and mark it when it's ready. I have a few other improvements I could work on and thought this would be a good one to get familiar with the project. Big fan!

@jakebox jakebox force-pushed the jb/dateformat-support branch from e77ef8c to aa1f493 Compare September 25, 2025 16:35
@jakebox jakebox marked this pull request as ready for review September 25, 2025 16:38
@jakebox
Copy link
Author

jakebox commented Sep 25, 2025

Okay, this should be ready! All of the taskwarrior date formats (https://taskwarrior.org/docs/dates/) are mapped to chrono (https://docs.rs/chrono/latest/chrono/format/strftime/index.html) formats, and any other characters just get passed through raw. If no format is provided we fallback to the existing Y-M-D. @kdheepak

@jakebox
Copy link
Author

jakebox commented Sep 26, 2025

These errors are from a file I haven't touched. Want me to fix them in this PR or another one?

@kdheepak
Copy link
Owner

If you can fix this in this PR that would be awesome! But no worries, I can also look at them later.

@jakebox
Copy link
Author

jakebox commented Sep 27, 2025

Fixed! I was on cargo 1.86.0 and the CI is running 1.90.0, this warning is new so I missed it.

@jakebox jakebox marked this pull request as draft September 29, 2025 15:54
@jakebox
Copy link
Author

jakebox commented Sep 29, 2025

Just want to check over a few more things.

@jakebox
Copy link
Author

jakebox commented Oct 5, 2025

Okay, we're ready now! I had realized that I was picking up some extra spaces into the ID column, it took me a second to track down but I fixed that bug (11da7c8). @kdheepak

@jakebox jakebox marked this pull request as ready for review October 5, 2025 16:08
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

Successfully merging this pull request may close these issues.

2 participants