iridakos / stup

Daily notes in the terminal :penguin:
https://github.com/iridakos/stup
MIT License
415 stars 31 forks source link

stup week misbehave #52

Closed ghost closed 4 years ago

ghost commented 4 years ago

I type commands like this:

date > stup-week.txt
stup week >> stup-week.txt
cat ./stup-week.txt

And the output is like this:

pon, 9 lis 2020, 16:29:04 CET
Displaying notes from(B poniedziałek listopada 02, 2020(B to(B niedziela listopada 08, 2020(B

Date:      poniedziałek listopada 02, 2020(B(B
Category:  plany(B

           • Nauka matematyki.

Date:      wtorek listopada 03, 2020(B(B
Category:  plany(B

           • Nauka matematyki.
           • Kopia zapasoawa.
           • Certyfikat BHP do biblioteki.
           • Instrukcja laborki z fizyki.

Date:      środa listopada 04, 2020(B(B
Category:  działania(B

           • 17:46:27 Jedzenie pizzy Gusepe.
           • 18:29:10 Nauka matematyki.
           • 20:17:34 Nauka fizyki.

Category:  plany(B

           • Nauka matematyki: 18:00-20:00.
           • Nauka fizyki: 20:00-21:15.

Date:      czwartek listopada 05, 2020(B(B
Category:  działania(B

           • 17:45:00 Nauka fizyki.
           • 19:00:01 Mycie szklanego stołu. Porządkowanie dokumentów samochodu. Zamawianie koszulek na materiały do nauki.
           • 20:21:00 Aktualizacja Podstawowe Zabezpieczenie Stacji Roboczych Linux Debian.

Category:  plany(B

           • 17:00 Konsultacje.
           • 17:30-19:00 Nauka fizyki.
           • 19:20-21:20 Aktualizacja Podstawowe Zabezpieczenie Stacji Roboczych Linux Debian.

Date:      niedziela listopada 08, 2020(B(B
Category:  plany(B

           • Lab. z fizyki: ćw. Torsje.

Explanation: Today is 2020-11-09. But stup week shows notes from 2020-11-02 to 2020-11-08. It is had to say if this is first week or previous week (but definitlely both). For seek of completnes I quote help: week Alias to list the notes of current week

ghost commented 4 years ago

Since I don't hope for new PRs to be merged (@iridakos feel free to prove me wrong), I'll just give you what I think should fix it:

change https://github.com/iridakos/stup/blob/187c8409ea10785bceb3ec87b38558abaea71755/stup#L1165 to

      FROM_AT=$(date -d "$(($(date +%u) - 1)) days ago" +"%Y-%m-%d")

Please let me know if it works as you want, when I get time&mood I'll re-check all such things & PR them (even if it won't be merged)

iridakos commented 4 years ago

@EnergoKoder Thank you for reporting this issue! @tiosgz Thank you for the workaround! And sorry for the delay merging this PR, I had forgotten it!

ghost commented 4 years ago

@iridakos Okay then, time to start working on the rest!

I've switched my notes system several times since then, but I think I'll enjoy stup once again. Btw., have you realised it's puts backwards? :-D

iridakos commented 4 years ago

@tiosgz

@iridakos Okay then, time to start working on the rest!

Yay! I will put some work on it as well, starting from a new configuration option that will allow users to set the list icon (currently set to a bullet).

Btw., have you realised it's puts backwards? :-D

No I hadn't! :laughing:

ghost commented 4 years ago

Please let me know if it works as you want, when I get time&mood I'll re-check all such things & PR them (even if it won't be merged)

Works perfect! Thank you for rapid resurrection!