Time Ago Formatter

Introduction

The Time Ago Formatter allows you to calculate the duration between two input dates from the same list. You can choose from several methods to compare these dates and get the result in different formats.

Plugin information

  • Plugins Available in the Bundle: Time Ago Datalist Formatter
  • This plugin bundle is compatible with Joget DX 7 and onwards.

Get started

Where to get the plugin

You can download the Time Ago Formatter plugin from the Joget Marketplace.

How to install

  1. Click Download on this plugin screen (It will be a .jar file).
  2. Go to your Joget localhost or server. In the Joget Console, go to Admin Bar > Systems Settings > Manage Plugins and click the Upload Plugins button.
  3. Under Upload Plugin, select the plugin .jar file you downloaded and click Upload.
  4. Depending on the plugin type, you can now view your new plugin in your form, List, or UI Builder.
  5. Remember to uninstall the old plugin before uploading a new version.
  6. The Joget Knowledge Base has more information on managing and developing plugins.

How to use it

Importing demo app
  1. Download the demo app from the Download Demo App.
  2. Go to Joget Home or All Apps and click Import App to import the downloaded demo app.

To create the app from scratch, continue following the steps below.

Creating app from scratch
  1. Create a form with a Date Picker field.
  2. Go to right up corner, click Generate App > Generate CRUD.
  3. Go to the List Builder. Play around with the plugin by duplicating the column and applying the Time Ago Datalist Formatter. For plugin configuration details, see Time Ago Formatter Properties.
  4. Publish and run the UI. You can see the difference in the dates that you configured.
  5. (Optional) Specify the Date Format configuration "yyyy/MM/dd" to be able to pick up the manual date format when processing.
    The plugin is able to pick up manual date format and process the value.

Configure time ago formatter properties

Fields to configure:

  • Duration: Different methods for comparing two dates.
    Available options:
    • From Column Date To Today
    • From Column Date To Another Date
    • Between Two Dates
  • Target Date: A different column date is taken in as one of the input dates to be compared with the existing Column Date.

    Only appears when Duration is selected as the From Column Date to Another Date option.

  • From Date: A different column date is taken in as one of the input dates to be compared with To Date.

    Only appears when Duration is selected as the Between Two Dates option.

  • To Date: A different column date is taken in as one of the input dates to be compared with From Date.

    Only appears when Duration is selected as the Between Two Dates option.

  • Date Output Format: Multi select box for date output formats for specific units.

    Available options:

    • year(s)
    • month(s)
    • day(s)
    • hour(s)
    • minute(s)
  • Include Format in Output: Checkbox field to determine whether to include format when date output format is chosen.
Extra date time format processing

For this section, date time default formats will be applied automatically; only specify if there are any extra formats. Formats should be separated by a comma, e.g.: yyyy-MM-dd, dd-MM-yyyy

  • Date Time Format: Default format: "yyyy-MM-dd hh:mm a", "yyyy-MM-dd HH:mm", "yyyy-MM-dd HH:mma", "yyyy-MM-dd'T'HH:mm:ss.SSSSSS", "yyyy-MM-dd'T'HH:mm:ss", "dd-MM-yyyy hh:mm a", "dd-MM-yyyy hh:mma", "dd-MM-yyyy HH:mma", "dd-MM-yyyy HH:mm"
  • Date Format: Default format: "yyyy-MM-dd", "MMMMMMMMM dd, yyyy", "dd-MM-yyyy"
  • Time Format: Default format: "hh:mm a", "hh:mma", "h:mm a", "h:MMA"

Expected outcome

The user is able to calculate the duration between two dates in the same list.

Download plugin

Download sample app

Download the demo app for Time Ago Formatter:
Created by Julieth Last modified by Aadrian on Nov 19, 2024