get_time_ago library

Classes

ArabicMessages
The ArabicMessages class provides Arabic language-specific implementations of the Messages interface. This class is used to format the "time ago" strings in Arabic.
Data
The Data class holds all constant and runtime data used in the package. This includes default locale settings, default messages, and a map of supported locales along with their corresponding Messages implementations.
DutchMessages
The DutchMessages class provides Dutch language-specific implementations of the Messages interface. This class is used to format the "time ago" strings in Dutch.
EnglishMessages
The EnglishMessages class provides English language-specific implementations of the Messages interface. This class is used to format the "time ago" strings in English.
EspanaMessages
The EspanaMessages class provides Spanish language-specific implementations of the Messages interface. This class is used to format the "time ago" strings in Spanish.
FrenchMessages
The FrenchMessages class provides French language-specific implementations of the Messages interface. This class is used to format the "time ago" strings in French.
GermanMessages
The GermanMessages class provides German language-specific implementations of the Messages interface. This class is used to format the "time ago" strings in German.
GetTimeAgo
The GetTimeAgo class provides functionality to format a DateTime object into a human-readable "time ago" string such as "a minute ago", "5 days ago", etc. It supports multiple locales and allows for custom locale messages. You can also specify custom date formats for cases where the time difference is too large. The class handles different time units such as seconds, minutes, hours, and days, and provides localized messages accordingly.
HindiMessages
The HindiMessages class provides Hindi language-specific implementations of the Messages interface. This class is used to format the "time ago" strings in Hindi.
IndonesianMessages
The IndonesianMessages class provides Indonesian language-specific implementations of the Messages interface. This class is used to format the "time ago" strings in Indonesian.
JapaneseMessages
The JapaneseMessages class provides Japanese language-specific implementations of the Messages interface. This class is used to format the "time ago" strings in Japanese.
KoreanMessages
The KoreanMessages class provides Korean language-specific implementations of the Messages interface. This class is used to format the "time ago" strings in Korean.
Messages
The Messages abstract class defines the interface for localization messages used in formatting "time ago" strings. Implementations of this class should provide specific messages for different time intervals (e.g., seconds, minutes, hours) and optional prefix/suffix strings to be used in the final output.
OccitanMessages
The OccitanMessages class provides Occitan language-specific implementations of the Messages interface. This class is used to format the "time ago" strings in Occitan.
PersianMessages
The PersianMessages class provides Persian language-specific implementations of the Messages interface. This class is used to format the "time ago" strings in Persian.
PortugueseBrazilMessages
The PortugueseBrazilMessages class provides Portuguese(Brazil) language-specific implementations of the Messages interface. This class is used to format the "time ago" strings in Portuguese(Brazil).
RomanianMessages
The RomanianMessages class provides Romanian language-specific implementations of the Messages interface. This class is used to format the "time ago" strings in Romanian.
SimplifiedChineseMessages
The SimplifiedChineseMessages class provides Chinese(Simplified) language-specific implementations of the Messages interface. This class is used to format the "time ago" strings in Chinese(Simplified).
TraditionalChineseMessages
The TraditionalChineseMessages class provides Chinese(Traditional) language-specific implementations of the Messages interface. This class is used to format the "time ago" strings in Chinese(Traditional).
TurkishMessages
The TurkishMessages class provides Turkish language-specific implementations of the Messages interface. This class is used to format the "time ago" strings in Turkish.
UrduMessages
The UrduMessages class provides Urdu language-specific implementations of the Messages interface. This class is used to format the "time ago" strings in Urdu.
VietnameseMessages
The VietnameseMessages class provides Vietnamese language-specific implementations of the Messages interface. This class is used to format the "time ago" strings in Vietnamese.

Functions

convertToUrduNumbers(int input) String
Utility function convertToUrduNumbers to convert an English number into its Urdu numeral equivalent. The function takes an integer input and replaces its English digits (0-9) with corresponding Urdu digits. Example: 123 -> '۱۲۳'
formatMessage(String prefix, String msg, String suffix, Messages message) String
Helper method formatMessage to format a time message by combining the prefix, msg (main message), and suffix. The method concatenates the non-empty parts of the message using the Messages.wordSeparator() to join them. Example: "about", "5 minutes", "ago" -> "about 5 minutes ago"