Because of the particular way I have my todos set up (They are unique timestamp titles and I use streams to generate them) I’ve further modified my implementation to accept data-caption={{!!text}} which generates a nice little calendar block for me:
eventReceive(e) {
const tiddlerTitle = e.draggedEl.dataset.title;
const caption = e.draggedEl.dataset.caption;
if (tiddlerTitle) {
// Get UTC time values
const startUTC = e.event.start.getTime();
const endUTC = e.event.end.getTime();
// Format dates directly from UTC timestamps
const formatDate = (timestamp) => {
const date = new Date(timestamp);
return date.getUTCFullYear() +
String(date.getUTCMonth() + 1).padStart(2, '0') +
String(date.getUTCDate()).padStart(2, '0') +
String(date.getUTCHours()).padStart(2, '0') +
String(date.getUTCMinutes()).padStart(2, '0') +
String(date.getUTCSeconds()).padStart(2, '0') +
'000';
};
// Update the tiddler's fields
$tw.wiki.setText(tiddlerTitle, "calendarEntry", null, "yes");
$tw.wiki.setText(tiddlerTitle, "startDate", null, formatDate(startUTC));
$tw.wiki.setText(tiddlerTitle, "endDate", null, formatDate(endUTC));
$tw.wiki.setText(tiddlerTitle, "caption", null, caption);
// Remove the event that was automatically created
if (e.event && typeof e.event.remove === 'function') {
e.event.remove();
}
}
}
Will just need to modify the “delete” button to remove the calendar field rather than removing the event altogether – any idea where to start?
Do you mean that you have imported them manually, or you have a method for importing G-Calendar events into your wiki? I would be interested in any method for doing that, I set it aside as a possibility last time I thought to look into it.
I share some calendar events with others, so I will need to continue to use Google Calendar, but being able to see my google calendar events reflected in tiddlywiki without needing to manually move the info would be very nice.
