Git Product home page Git Product logo

Comments (8)

vonshednob avatar vonshednob commented on May 28, 2024

Oh yeah, I absolutely agree! Currently there’s a bigger refactoring on-going which will make this easier.
So, it’ll happen, but not very soon.

Not quite sure about the due: completion though; since it’s very dynamic what you could write there (2022-02-02, +4d, tue, +1y2w-2d) it would almost require a calendar selection, but even that wouldn’t quite cut it.
Any ideas?

from pter.

maxigaz avatar maxigaz commented on May 28, 2024

One is idea is to make an option to specify the date format, and use it as the basis of converting to/from.

In khal, for example, you can set the format for both the short date and the long date. I have the following in my ~/.config/khal/config:

[locale]
timeformat = %H:%M
dateformat = %m.%d.
longdateformat = %Y-%m-%d
datetimeformat = %Y-%m-%d %H:%M
longdatetimeformat = %Y-%m-%d %H:%M

So, maybe pter could detect that if I started writing due:2021 and I have %Y-%m-%d configured as the format, so pressing tab could complete the date as due:2021-10-17.

from pter.

vonshednob avatar vonshednob commented on May 28, 2024

Not quite sure how it would complete the date though, if I only type due:2021 and Tab… would it show a completion option for month and day?

Just curious: are you using absolute dates in due: and t: more often than relative dates? I keep finding myself rather settings tasks up to be at due:sat or due:+1w.

from pter.

maxigaz avatar maxigaz commented on May 28, 2024

if I only type due:2021 and Tab… would it show a completion option for month and day?

Actually, I was only thinking of completing the current date, but I understand that not everyone would find it adequate.

So, another option would be to print out the current date in a specified format (such as %Y-%m-%d), and create highlighted tab stops for each number (so pressing tab highlights the month, pressing it again highlights the day etc.), which could be increased/decreased with the arrow keys or overwritten if a number was pressed.

Just curious: are you using absolute dates in due: and t: more often than relative dates? I keep finding myself rather settings tasks up to be at due:sat or due:+1w.

Yes, I prefer absolute dates. I think the main reason is that they are easier to be parsed by scripts. (I have a Polybar script that notifies me if I have tasks due today.)

from pter.

vonshednob avatar vonshednob commented on May 28, 2024

Ah, that was maybe a misunderstanding. I gotta check the documentation whether it's not clear enough.

When editing tasks, you can enter a relative date, for example, due:0 (meaning: due in +0 days, i.e. today), but the todo.txt standard does not actually allow for relative dates. Instead pter will save the date as an absolute date!

So, if I add a task in pter today, like Add autocompletion to contexts in +pter due:+1w, pter will expand the due: tag to due:2021-10-25 -- i.e. 1 week (7 days) from now.

Have a look at the section on relative dates in the documentation!

Would this alleviate the need to have autocompletion for the t: and due: tags?

Obviously the + and @ fields need autocompletion though.

from pter.

maxigaz avatar maxigaz commented on May 28, 2024

When editing tasks, you can enter a relative date, for example, due:0 (meaning: due in +0 days, i.e. today), but the todo.txt standard does not actually allow for relative dates. Instead pter will save the date as an absolute date!

So, if I add a task in pter today, like Add autocompletion to contexts in +pter due:+1w, pter will expand the due: tag to due:2021-10-25 -- i.e. 1 week (7 days) from now.

Have a look at the section on relative dates in the documentation!

Oh, I didn't know pter has this feature. Very useful! (And I'll keep reading the documentation. :))

Would this alleviate the need to have autocompletion for the t: and due: tags?

Yes, absolutely! (As far as I'm concerned.)

from pter.

vonshednob avatar vonshednob commented on May 28, 2024

Autocompletion is implemented in 2.1.0.

I was a bit too eager to push it out of the door, so the documentation is not great (i.e. missing). It’ll come later.

For now: Tab, ^N, and arrow key down will select the next available option, ^P, and arrow key up will select the previous option. Enter is used to select the completion option, Esc and ^C will close the completion box.

Completion works for contexts (@) and projects (+).

from pter.

maxigaz avatar maxigaz commented on May 28, 2024

Thank you very much!

from pter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.