A simple list of dates using a date picker

I am stuck here.

All I need is a simple list of timestamps. Something like this:

2021-09-27 Mon 11:00 – 2021-09-27 Mon 15:00
2021-09-29 Wed 13:00 – 2021-09-30 Thu 23:55

Entering them by hand is not too practical. So, I wanted to use a date picker plugin. But they need a field to edit. How do I get to pick a date without using a field?

2 Likes

A Quick answer before bed.

I think to get what you want you need a date picker to set a field in a temp tiddler, then an action to copy it to the clipboard and/or use it as a text insert/paste.

Alternatively learning how to make an Editor Toolbar button that does this for you.

$:/plugins/tongerner/timestamp stamps “now” in the text as a hint at what it would look like.

Hello deshmukh
I’m not sure whether this would be what you need but it will give you an idea of how it could be done.

https://andjar.github.io/TiddlyTime/index.html

It might, if I could figure out how in the world one edits a tiddler in that wiki so I could look at the wikitext! Am I missing something? In the control panel the appropriate button on the view toolbar is enabled, but the toolbar doesn’t show up at all.

It took a little digging about:

  1. Show the sidebar (double-chevron, upper right corner of page)
  2. View “More”, “System” tabs
  3. Open $:/core/ui/ViewTemplate/title
  4. From that tiddler’s toolbar, in the “more” menu, select “delete”

This restores the default (shadow) title ViewTemplate, allowing the standard tiddler toolbar to appear on the “Home” tiddler, so you can edit it to see the wikitext.

-e

Sorry everyone,
I didn’t realise it was complicated to look under the hood, so to speak.
I just came across the example tw a while back. Thought it would be useful in the future when I learned more about tiddlywiki and it’s workings.
Thanks @EricShulman for helping out

Scot

1 Like

@Scot Thanks for sharing the wiki. And @sobjornstad Thanks for asking the question I was shying away from asking and @EricShulman Thanks for solving that problem.

But that is not what I want to do. The dates I want to enter could be in the past or in the future. In the website you mention, we are not ‘editing’ the date. We are capturing the current time.

@TW_Tones Thanks. I could make some progress. But very little. One tiddler has:

<$edit-date tiddler="SetTargetDay" field="from" format="YYYY-MM-DD ddd HH:mm" showTime use24hour>

<$edit-date tiddler="SetTargetDay" field="to" format="YYYY-MM-DD ddd HH:mm" showTime use24hour>

Hello World

My first problem was that nothing after the first $edit-date widget displays! Of course, I am doing something really stupid But I could not figure out what.

In another tiddler, I have:

<$view tiddler="SetTargetDay" field="from" format="date" template="YYYY-MM-DD ddd hh:mm">

Hello World

This displays the date set in the first tiddler. But not the text Hello World.

Moreover, I could not do the next leg ie. copying this text into something and appending it to a list, etc.

Also, why is not anything after the first widget displaying??

Hello,

/>
<$edit-date ... />

<$edit-date ... />

Hello World

Without being able to try your code and test, pretty sure that’s it.

For most widgets, you need to close the tag at the end:

<$edit-date tiddler="SetTargetDay" field="from" format="YYYY-MM-DD ddd HH:mm" showTime use24hour/>

Notice the /> at the end.

The exception is widgets like the list widget, which often works with an opening <$list> tag and ends with a closing tag </$list> .

@Mark_S and @Charlie_Veniot Thanks. That was it. That solved the problem.

I still am not able to get that text appended to a nicely formatted list. :slightly_frowning_face:

Any ideas there?

Since you are using the edit-date widget from Eric’s solution you will need to wade through the documentation on the edit-date widget. Although a valuable tool edit-date is not part of the core tiddlywiki so you are asking more from the community to help you, they may need to install the widget first.

I still am not able to get that text appended to a nicely formatted list. :slightly_frowning_face:
Any ideas there?

Once you ensure the edit date widget is closed /> as you did and that works please ask a new question with some details.

@deshmukh I don’t want to discourage you from asking questions, but I do want to ask you to try a little harder before asking questions and when you do go out of your way to present clear questions that show the code in question, explain the problem, perhaps even what you tried first.

We are all volunteers and anyone who is posting a lot of questions, which is fine, however if those questions are not clear and demonstrate you have not tried that much at all, to resolve them yourself, it is a little annoying. In time you may find people neglecting your questions.

I understand that edit-date widget is not part of the core. But I was under an impression that it is quiet appropriate to ask questions about plugins that are widely used. edit-date, in my mind, is one such plugin.

Secondly, this particular question was not about the plugin or its use. It was about some functionality about that is quite basic TiddlyWiki — appending contents of fields of TiddlerA to the text of TiddlerB.

Yes, I understand that we are a community. And let me mention my most sincere gratitude to all of you. Especially, you. Your inputs have been very useful.

At the same time, I am very sure that I have not asked even one question without trying to solve it myself. And I have tried as hard as I could, and more. After your comment, I have gone through all my questions and found that most of them are well-written, several of them have pieces of code. Moreover, I have adequately and meaningfully participated in the subsequent discussions, too.

I am a complete newbie. And have zero programming experience. It is likely that some of my questions may be very basic, very naive. But that is because of lack of experience, not lack of effort on my part.

Based on your comments, which I take very seriously, I will ask fewer questions. If and when I do ask a question, I will try to put in as much data as possible, including any code I may have developed, to make the question clear to the reader. But frankly, that is exactly what I had been doing! So, I may, still fall short of your standards. :slight_smile:

You are not falling short of any standards. However I think we need to support each other in finding our own way as well. I will help you too. Presently I do spend a lot of time supporting the community but I and many others try support growth just not answers. Thanks for taking what I said seriously but forget it and let’s move forward. I am excited to see you enthusiasm and involvement.

Help us help you!

Maybe once can make a sidebar tab that would generate the actual list of dates.

It would contain two edit-date widgets, one for the “from” date and the other for the “to” date. Both store the dates in state tiddlers.

An “add” button will then add date1, " - ", date2, then a linebreak, into the text field of another state tiddler. After multiple operations, you should have your list of pairs of dates stored in a state tiddler.

Then we can use an editor toolbar button to insert the contents of that state tiddler into the tiddler you’re currently editing.

One could also use a popup in an editor toolbar button, like with the excise button, but I’m a TW newb too and the RevealWidget and popups make my head swirl. I might try the above method by Saturday.

  • state tiddler = a system tiddler that usually starts with $:/state/, used for storing temporary data

FYI: The prerelease actually now has a tool to create new editor toolbar buttons dynamic toolbar buttons

Remember I did point to the timestamp Editor ToolBar button which inserts a now time date into the text field, a modified version would allow a picker as well.

Here it is. list-dates.json (497.7 KB). Drag and drop it into your TW to import it. It includes a sidebar tab where you can add dates with the datepicker, and an editor toolbar button that can insert it. The icon for the button is a calendar icon. Or, you can press Ctrl + I instead.

(Keyboard shortcuts can be changed in the Control Panel.)

The datepicker isn’t working properly on my end, though—maybe some timezone setting or whatever.

Have a great day!

1 Like

500kByte for something that probably needs a couple of lines of wikitext. Are you sure ?!?!

Oh, included the datepicker and moment.js plugins. I neglected to mention that. The actual thing is just a few kB. :smiley:

@sull-vitsy Thanks! This works just as expected.

1 Like