[SOLVED] How to achieve relative date (today, yesterday etc)

I’m trying to display relatives date/hour (ex. if creation date = current date display: today, if not display day: “5”) but I couldn’t get it. Can someone help me find out?

Well, I got it by making a text “today” hidden to show up when “creation date - current date:formatted as days is 0”. Now I have to do one for “yesterday” and another for display other dates.

It would be good to chain some conditions in 1 workflow (if this or else statement)

It’s broken - more days are being considered “today”, trying to find out why

I had to use :extract day on both, now it’s sooo cute :slight_smile:
= 0 for today, -1 for yesterday and the image value for all other days

4 Likes

Yo!

So I had to list down items from the database and have them grouped by Today, Yesterday, Past Days.

The problem: comparing items with date (e.g. created date) and you don’t get a match up because of the time part.

Solution: I created a field of type text and store a copy of the date without the time. I then created a repeating group and get all the unique date text from our new field. After establishing all the dates, I added a new repeating group within the first repeating group to contain the items matching every date text. Additional conditional formatting may be needed for headings on each group (e.g. “Today”, “Yesterday”)

-Clint

2 Likes

Very elegant solution

1 Like

Just a update: I don’t use visibility anymore, I just use 1 text element, and in “conditional” tab I use the “text” property to display today, yesterday etc

2 Likes

I have a slightly different version of this, but am also confused by something.

I have 2 elements:

Text element contains the date in my database that I want to display as Yesterday, Today or Tomorrow depending on today’s date.

Input element that is of content format ‘Date’. I use these conditions on the Text element to make it work:

http://g.recordit.co/9bWQEGkT1r.gif

What I dont understand is why the +1 day results in Yesterday and the +days -1 day results in Tomorrow.

Actually to be complete, this is how I implemented it:

I put the input field in the same repeating group is the text I want to manipulate (same initial value) and then hide it.

1 Like

Does anyone know a solution to mark days older than yesterday? I want to red flag any date that is past the due date + yesterday but the use of < seems to be pretty limited…

1 Like

Got the same issue. Any idea how to delete a listing that is overdue?

how to filter data base for today?
with a “date” database not text :slightly_smiling_face:

does not work :roll_eyes:

When you extract day it will remove month and year, so it won’t get the right date. I didn’t have a ready solution, but I’d start testing like “created date [equal <] current date - 12 hours”.

Or maybe creation date “< current time set hour to 00 minute to 00” It should find all selected things create this day after 0:00 hs.

Hi @lioktabriansyah you can filter your search for as you can seen in this print
image

In my case, i display a sum of data registered yesterday. In your case, you can do same, except the +day -1.