Round result created_at and adding custom string

Options

Hi,
I've managed to convert the basic timestamp to minutes ago if it's under 60 minutes, hours ago if it's under 24hours and days ago if it's over 24h ago. I now have two problems left:

1. Where do I add the "round" filter at the end so that there are no decimals?
2. How can I add the string "minutes ago/hours ago or days" ago to the response?

Here's my function stack so far:

Answers

  • Cameron B
    Cameron B Member, Administrator

    ADMIN

    Options

    Hey! You add the round filter to the end of the variable/value that you're manipulating. To add text to this value, you can use the concat filter (after you round it), which allows you to provide a value to concat with.

    I hope this information helps, but let me know if you have any other questions :)

  • filiphartman
    Options

    Thank you! I actually managed to figure it out earlier, but doing exactly what you described :)