'3 days ago', 'a month ago' 'tomorrow'

Is there a way of showing this from a date within a sheet referencing today’s date?

In Glide yes, it’s trivial with Date math.

  • 3 days ago: Now - 3
  • tomorrow: Now + 1
  • a month ago: Now - 30 (rough approximation - if you need exactly one month, that’s possible but a slightly more complex formula required)

Some references:

2 Likes

Thanks Darren, I’ve got something working, but it will only show day count

I’m looking for the reverse of what’s in this next image. you auto display natural language based on a date

1 Like

ah, I see.

Well, that’s certainly possible. What I’d suggest is to start by defining all the rules, and then you can build the logic to fit into those rules. You’ll most likely need a combination of Math columns, Template columns and if-then-else columns.

The logic could get quite hairy, depending on how far you want to take it. But it’s certainly doable.

I thought this was a nocode platform! :rofl:

Zero code required, I can assure you of that.

It’s probably not that bad, actually. Let’s just consider the case of dates in the past.

Your “rules” might be something like:

  • Within 5 mins of now: “just now”
  • More than 5 mins ago, but less than one hour: “xx mins ago”
  • More than 1 hour ago, but less than 2 hours ago: “1 hour ago”
  • More than 2 hours ago, but less than 24 hours ago: “xx hours ago”
  • More than 24 hours ago, but less than 48 hours ago: “1 day ago/yesterday”
  • More than 2 days ago, but less than 7 days ago: “x days ago”
  • etc…
  • etc…

To get the above, you’d need:

  • One math column for each of the time units (mins, hours, days, weeks…)
  • A template column for each of the above display options (which would use the appropriate math column as a replacement)
  • And then a single if-then-else column to determine which template column to use based on the calculated age

That’s how I would approach it.
But if you want to wait a couple of hours, our resident date/time wizard, aka Chuck Norris, aka @Jeff_Hager should be around, and he’ll show you how to do it with just one column :rofl:

4 Likes

I just built this last night in fact:

10 Likes

What’s with the whispering, everybody else still asleep in the Petitto household? :joy: :sleeping:

They sure are :wink:

Adalo have a fairly elegant solution to this, i’m surprised more people don’t need this natural language

2 Likes

The commenting feature in Glide has relative dates by default. This relative date construct in Glide allows you to have relative dates anywhere.

Sounds like a feature request to me - agreed it would be great to have “out of the box” :+1:

1 Like

Ah interesting, thanks for pointing that out. Is that the only place it shows automatically? (I haven’t found a way to get a date data input to display like this). I’ll log a feature request.

As far as I’m aware, yes (except for the chat tab). It would be nice to have as an option within a date/time & math columns @mark @jason

3 Likes

Slightly unrelated, but this thread spurred this.

The new updates within database creation now let’s you do all the time/date stuff out of the box - fantastic.

3 Likes

Is there a way to display the dates for comments component NOT in relative mode but to present the actual date itself? Is there a switch I can flip for this?

I’ve asked Glide for this too. Not at the moment. Sounds like a good feature request :slightly_smiling_face:

2 Likes