Search metadata of type datetime

I added a custom metadata filed mdeventdate of type datetime. Now I’d like to use it in Smart Groups to filter specific dates, see screenshot.

The normal date/time options allow me to query for something like “today” or “tomorrow”. But I would like to query for something like

mdeventdate>=yesterday mdeeventdate <=tomorrow+1

The tomorrow option is not available and adding one day is not possible as well as it seems. Are there any practical solutions for things like this?

Date data types don’t support numerical operators lke you’re showing here. And currently relative dates aren’t supported. Development would have to assess this.

1 Like

If the documents you want this to act on are not madly numerous, a script could do what you’re looking to do. You could trigger the script to run once a day on documents which contain an event date, for example.

In fact, you may be able to limit the smart rule to something along the lines of today AND/OR last week AND/OR this week, meaning that the script wouldn’t have to go through so many documents.

Your script would then add or remove a tag, which you could use as a condition for the smart group

Thanks for the suggestion, and yes - some Applescript should do it (if a user is proficient enough to do so).

I just thought this would be something which could make sense building directly into the system.

Sure; my suggestion was only to support you in the meantime. Is that something you can script yourself, or would you like assistance?

Thanks for the offer. I will take the opportunity and script a little for myself :wink:

I thought you might :grin: