Pickaday-Plugin: Adjust ToDo-List & add date-calculation: Howto?

Hello @all,

trying to build a ToDo-Manager inside TW, I tried ToDoNow from Telmiger, but had to give it up. The related threads are: How to adjust ToDoNow? & ToDoNow: How to include a calculation of due-dates?
Now I choosed https://kookma.github.io/TW-Pikaday/. The ToDo-List inside there also almost fits my needs.
Some questions I still have for adjusting it:

1] The titles of the tasks inside the ToDo-List are repeated endlessly in the cell. How to avoid that?

.

2] And how to achieve, that long titles are shown completely (not cutted at the end, instead the row just gets higher)?

.

3] I need a calculation of due-dates (f.e. add 1 year or 14 days), which is useable inside the ToDo-list.
Mostly I need the calculation from “today” (=<<now>>), but sometimes also from the original due-date.
In the ToDo-list I need 3 fields:
1: number =how many,
2: days /months /years
3: from today or from the original due-date,
for being able to say f.e. “add now 1 year to today” or “add now 14 days to the original due-date”.

Or even the best: If this calculation could be inside of the Pickaday-Popup, this would be really a dream :slight_smile: .

These two work for me, but they do not bring the full features needed for me:
$:/_Macros/FutureDate.js, file to download
and Date Conversion Macros .

How can I adjust them to get the features which I need?
Or do you know any other possibility?

.

And over all: If you need a TW with the mentioned things inside to play around with it: Should I upload that here? Or somewhere online?

Thank you all, Noushka
TW 5.3.3, Firefox, Windows 10

This would help people help you. Get and make a free tiddlyhost.com account and public site. Load it with your tiddlers or upload to replace the tiddlyhost site.

You are asking a lot of question, which in future you may divide into a different post for 1/2 and 3

Hej,

I made that public wiki with the corresponding tiddlers: Tests.

Okay.

Thanks in advance :slight_smile:

@Noushka thanks for putting it online, I see we have different Languages, the google translator has helped me a little.

Observations;

  • I see you are using dynamic tables by @Mohammad and part of Shiraz, but you don’t have the shiraz plugin installed, and I am not that familiar with this
  • I Keep getting a script error, did you install some javascript?
Internal JavaScript Error
Well, this is embarrassing. It is recommended that you restart TiddlyWiki by refreshing your browser
Script error.
  • So as not to spend too much time researching your issues I will give some tips, not answers to each or your questions, lets see if that helps.
  • I have tried to find the cause but not found it yet. This is the display of the title field, and looks like the output of a filter. Perhaps use {{!!title}} or add ..limit[1]] although this is most likely a coding error.
  • This should get better when you fix 1. This is possibly due to CSS which is causing the ... to appear rather than using multiple rows, I expect this is part of the dynamic tables CSS.
  • This is most likely related to question 1.

It is easier to list with relative dates eg days[+14] than display the future date, however to do date maths have a look at using the unixdate format, to which you can add a number of days. But this is not simple.

  • Convert tiddlywiki date to unix, add days which is a number with multiple zeros, then convert back to display.

Sorry I don’t have firm answers, If I can think or other tips or find a solution I will return.

It looks like you edited the template used to display the title column, $:/plugins/kookma/shiraz/templates/body/title, to use <$list to=<<currentRecord>>><$text text=<<currentRecord>> /></$list>. This isn’t valid syntax for the list widget, which is limited to the attributes documented here. Reverting to the original syntax used in the Shiraz plugin will solve the issue:

<td class="shiraz-dtable-title">
<$link to=<<currentRecord>>><$text text=<<currentRecord>> /></$link>
</td>

You’ve imported a subset of tiddlers from Shiraz but not the plugin itself, which isn’t necessarily an issue; I’ve done it myself when I only needed a few tiddlers from a larger plugin. However, it does mean that you don’t have a shadow tiddler as your “source of truth”.

  • It’s not obvious what you’ve changed, or how, without going back to the original source. If you did have the full plugin, you could use the “differences from shadow” preview mode; as it is, there’s nothing to compare.
  • You can’t just delete your modified version to restore the original behavior, as you can with a plugin tiddler.

You may want to avoid importing plugins piecemeal if you’re not confident that you understand how they function and what you can safely change without breaking anything.

As Tony said, your 2) can probably be fixed with CSS. I’ll take a look and get back to you.

1 Like

As you can see in the codeblock above, the title cell uses the “shiraz-dtable-title” class, which is defined in $:/plugins/kookma/shiraz/styles/dynamic-tables. Here’s the current style definition:

.shiraz-dtable-title {
  width: 100%;
  max-width: 25rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

You can either edit the existing Shiraz stylesheet tiddler, or add the following code to another tiddler with the tag $:/tags/Stylesheet. Make sure that it comes after $:/plugins/kookma/shiraz/styles/dynamic-tables in the tag dropdown so it will take precedence.

.shiraz-dtable-title {
  overflow-y: auto;
  text-overflow: unset; /* Included for completion only; you shouldn't really need this line if the other properties are set. */
  white-space: unset;
}

Edit: In this case, I already knew which CSS class to search for—but in cases where you don’t, I recommend using your browser’s inspector function, which should let you highlight an element on the page to see the classes currently being applied.

1 Like

This was the solution against the endless title-repeating- Thanks :slight_smile: !
Unfortunately, the title is now of course again a link, which I didn’t want (and changed on that reason). Because when using it on tablet now I have to put my fingers really exactly on the arrow to show the text of the task (in my case the subtasks) instead of opening the task.
Is there no way to show the title without linking to it?

Superduper, that’s working fine :slight_smile:

I open now another thread for the date-calculation. Tones, I am sorry, I did not really understand a word from your answer towards the date-calculation… :flushed:

Certainly! You can remove the link widget from around <$text text=<<currentRecord>> />, which is the part that displays the title.

Fantastic :smiley: :+1:

Aaaand… Is there a way to have the title-field also in edit-mode when editing? So, when clicking on the “edit”-button on top of the table, that the title is than editable like the other fields like priority, tags and so on?

Yes, it’s technically possible, but I wouldn’t recommend it. Renaming a tiddler is more complicated than editing a normal field—to see what I mean, try editing the title of a preexisting tiddler in edit mode.

  • You’ll see that you’re immediately prompted to update the title in any corresponding tags and list fields (and if you’re using the Relink plugin, it will update the title in the other tiddlers you’ve specified as well).
  • If you check the box, these changes will be applied when you save the tiddler.
  • Editing the “title” field in the dynamic table wouldn’t automatically apply any of these changes.

Even if you’re not interested in updating title references, you can’t edit the title field in real time. The new title won’t correspond to the same tiddler under a new name; it will be a brand new tiddler without any field content, and since it doesn’t have the appropriate tag, it won’t appear in the table. If you were going to work around this, you’d need to…

  • Make a “title” input box that doesn’t correspond to the title of the tiddler you’re currently editing, but to a temporary placeholder tiddler. Use the current title as the “placeholder” text of the $edit-text widget—the text that will appear by default, before you’ve made any modifications.
  • Add a “done” button to click once you’ve finished with your title edits. Clicking the button will clone the preexisting tiddler shown in that row, give it the new title stored in the temporary tiddler, and then delete the original to-do.
    • You’d probably want to wrap this button in a conditional filter so that it only appears if you’ve made changes to the title. Otherwise, it won’t be very apparent when you have an unsaved title change.
    • If you don’t click the button, the title won’t be updated.
    • If you want any relinking/tag-updating to happen, you’d need to include those steps in the button actions as well.
  • You may also want to add a warning that appears if your “new” title is a preexisting tiddler—otherwise, you risk overwriting another unrelated tiddler.

Oh my god… ähem, oh no, that sounds toooo dangerous for me… :hot_face:
Thank you nevertheless!

Hi all,
long long time it took… a lot of answers… a lot of without answers… a huge amount without any success… but again and again and again trying…

I gave up the original trial, no more tweaking different plugin, instead builded my own solution. Without any talent for coding, so it took a huge amount of time and is quite DIY-like- but for me not such a problem. Now I have my working ToDo-solution, with the style I like and all basic functions working.
The only functions I am still not able to build are about sorting-list-by-select and about batch-editing. But this I’ll ask in new topics.
Thanks for all your help!

1 Like

What a pity, I cannot reply to the other related topics with the same text. So sorry, that I do not answer anymore to the other related posts (how to build / edit /solve this and that for a ToDo-solution in TW).