The format() method formats a date according to the format used by Fluid Topics.
For example:
// Format using custom options
const options = {
locale: 'fr-FR',
longFormat: true,
withTime: true
};
formattedDate = FluidTopicsDateService.format("2024-09-27T12:34:56Z", options);
console.log('Formatted Date (custom options):', formattedDate);
The following table shows the different formatted dates for every possible combination of longFormat and withTime:
longFormat value |
withTime value |
Formatted date |
|---|---|---|
false |
false |
09/27/2024 |
false |
true |
09/27/2024 12:34 PM |
true |
false |
Sep 27, 2024 |
true |
true |
Sep 27, 2024, 12:34 PM |
- Both
longFormatandwithTimedefault tofalse. localedefaults to the current UI locale.- Only
en-USand the current UI locale are available as values forlocale.