MARKETPLACE
PLUGINS
RELATIVE TIME WITH MOMENT.JS
Relative Time with Moment.js logo

Relative Time with Moment.js

Published December 2017
   •    Updated today

Plugin details

Uses moment.js to display a date and time of your choosing relative to the current time (or a baseline date and time you specify), e.g. "Posted 2 days ago", "one week ago", "a few seconds ago" and so on. It even works for future dates - "in a month" or "in 2 days" etc.

Free

For everyone

4.6 stars   •   16 ratings
80.0K installs
This plugin does not collect or track your personal data.

Other actions

Platform

Web

Contributor details

Louis Adekoya logo
Louis Adekoya
Joined 2016   •   6 Plugins
View contributor profile

Instructions

1. Drag the "Relative Time" element on to your Bubble page. Keep it visible (it doesn't actually show up in view mode). 2. In the Properties pane, specify a value in the 'Date' property. This is the date and time you wish to compare to the current date and time. It can be a database date field, e.g. Comment's Creation date. It can also be the value of a date input.
3. Optionally specify a refresh interval in milliseconds. If you leave blank, the relative time will refresh when a related field or value changes or when the page is reloaded. If you do specify a value, the relative time will be auto-refreshed at the frequency you specify. Use with caution as refreshing too frequently may hinder performance or have unexpected consequences.
4. NEW: Optionally hide the suffix by ticking the Hide Suffix checkbox. This will output the value in the format "2 years" rather than "2 years ago" or "in 2 years".
5. NEW: Optionally specify a 'Baseline Date', to express your date relative to another dynamic date, instead of the default which is the current time. Leave blank to stick to the default.
6. Add a Text element to your page to display the relative time and specify its value as the "current value" of the Relative Time element you added in step 1. You may want to add some static text too, e.g. 'Posted' to get an output like "Posted a minute ago".

NOTES
a. You can also refer to the Relative Time's current value in a workflow.
b. You can add multiple instances to your page or use it in a Repeating Group.
c. For a demo of this plugin, go to: https://louisbubbleplugins.bubbleapps.io/version-test/relativetimedemo

Types

This plugin can be found under the following types:

Categories

This plugin can be found under the following categories:

Resources

Support contact
Documentation
Tutorial

Rating and reviews

Average rating (4.6)

Easy set up and works great!
October 7th, 2024
Works great!
September 5th, 2024
it is effective
August 14th, 2023
Works Just as expected
May 19th, 2023
Excellent plugin
May 5th, 2023
Just what I needed, easy to implement.
Bubble