Tinderbox Forum

Make EndDate = StartDate by default

I am entering lots of events. Some go on for days and months. Most take place on a single day. So I have set up a Prototype for Events with attributes including $StartDate and $EndDate.

How do I make the default $EndDate = $StartDate? This would mean that, for most events, I would only have to type the $StartDate.

Firstly, before possible nugatory work, why do you need an $EndDate? Tinderbox doesn’t need one for an event. I ask as if you want to find a zero length event it’s as easy to ask for one that has no $EndDate value set as it is to test whether start and end are the same date/time

If you really do need the $EndDate populated, I’d suggest an edict (disabled in the prototype itself - a boolean that doesn’t get inherited) with this code:

if($StartDate & $EndDate=="never") {
   $EndDate = $StartDate

IOW, only work on notes with a start date set. If there is one and the end date has a default value (“never”) then set the end to the same as the start.