Temenos Digital
Updated On 04 March 2025 | Min(s) read

Technical Details

This section explains the configurations, parameters of the date format that should be configured.

Display Date or DateTime

To display a date or datetime in the format as per the current locale in the UI, the utility function getDateTimeBasedOnLocale is used. This function takes the input date string (first parameter) and returns the formatted string as per the current locale based on the fabric runtime property for client App LOCALE_DATEFORMAT_MAPPING. This is defined in commonsMA (in FormatUtilManager). When the time part is also to be formatted, the second parameter need to be passed as true.

The Java script library ‘Intl’ has been used in implementing this utility function.

For the first parameter, make sure to send a string that can be converted to Date object. The string which is in dd/mm/yyyy or yyyy/dd/mm format cannot be converted into a Date object. So such strings cannot be passed to this function.

For example, if localeBasedFormattedDate = applicationManager.getFormatUtilManager().getDateTimeBasedOnLocale("2024-12-24", false);

  • If the current locale is en-US and the format is set as "MMM/dd/yyyy" in the fabric property for en-US then it returns Dec/24/2024
  • If the current locale is en-GB and the format is set as "MM.dd.yyyy" in the fabric property for en-US then it returns 12.24.2024
  • If the current locale is de-DE and the format is set as "MMM/dd/yyyy" in the fabric property for de_DE then it returns Dez./24/2024

Date Input

To get the configured format for the current locale, the utility function named getDateFormatConfigBasedonLocale (from FormatUtilManager) is used. The value returned by this function need to be assigned to the calendar widget’s dateFormat property.

For example, dateformat = applicationManager.getFormatUtilManager().getDateFormatConfigBasedonLocale();

  • If the current locale is en-US and the format is set as "MMM/dd/yyyy" in the fabric property for en-US then it returns MMM/dd/yyyy
  • If the current locale is de-DE and the format is set as "MM.dd.yyyy" in the fabric property for de_DE then it returns MM.dd.yyyy

In this topic

Copyright © 2020- Temenos Headquarters SA

Published on :
Sunday, March 23, 2025 3:05:17 PM IST