MARKETPLACE
PLUGINS
RELATIVE TIME (LOCALES) - MOMENT.JS
Relative Time (Locales) - Moment.js logo

Relative Time (Locales) - Moment.js

Published June 2019
   •    Updated this week

Plugin details

A version of the relative time plugin that includes all supported locales. 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.0 stars   •   3 ratings
4.5K 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.0)

Useful plugin but I'm having an issue
November 2nd, 2025
For some reason, I'm getting a "ReferenceError: moment is not defined" error from the browser console when the page is loading and the LocaleRelativeTime element is visible. Running moment() on the browser console after the page is loaded gives me no such error.
Using conditions, try not to reference the element until the page is fully loaded and the element is visible. It is usually something like this that causes an issue. Either that or there is a conflicting plugin on the page. To test for the latter, try on a fresh page without any other plugins. (plugin author)
November 2nd, 2025
  •  
Louis Adekoya
It's not working anymore
October 31st, 2024
Locale parameter is not changing anything now. The language remains in english
Hi, It still works for me, as seen here: https://louisbubbleplugins.bubbleapps.io/version-test/relativetime_locales_demo if you select a language in the dropdown on the left pane. Is it possible that you have a conflicting plugin on the page? Something else that is using/blocking moment.js, perhaps? (plugin author)
November 9th, 2024
  •  
Louis Adekoya
Just perfect!
December 29th, 2022
Works exactly like intended. Got it up and running in literally less than 30 seconds!
Bubble