system.kanoa.date.localizeDateFormat(existingPattern, localeTag)
Reorders only the day/month/year portion of an existing date pattern to match the given locale, leaving everything else (time-of-day tokens, seconds, am/pm, separators, day-name/timezone tokens, digit widths) exactly as-is. Works with either Java SimpleDateFormat tokens (dd/yyyy) or moment.js tokens (DD/YYYY) - detected from the existing pattern itself, so no dialect argument is needed. If the pattern has no day/month segment (e.g. a time-only pattern), it is returned unchanged.
Parameters
existingPattern String: An existing date/time format pattern, i.e. 'MM/DD/YY hh:mma' or 'M/d/yyyy HH:mm:ss'
localeTag String: Locale tag, e.g. session.props.locale ('en-US', 'en_GB', 'ja-JP'). Both BCP 47 hyphens and Java Locale#toString() underscores are accepted.
Returns
pattern String: existingPattern with only its day/month/year field order changed, e.g. 'MM/DD/YY hh:mma' -> 'DD/MM/YY hh:mma' for a day-first locale
Example
existingPattern = 'existingPattern'
localeTag = 'localeTag'
pattern = system.kanoa.date.localizeDateFormat(existingPattern, localeTag)