/** * Returns localized format strings. * @param locale selected locale * @return {@link FormatStrings} object. Throws exception if not found. */ @Nonnull public static FormatStrings getFormatStringsNN(Locale locale) { return getFormatStringsRegistry().getFormatStringsNN(locale); }
@Override public void afterPropertiesSet() { UserSessionSource userSessionSource = beanLocator.get(UserSessionSource.NAME); FormatStringsRegistry formatStringsRegistry = beanLocator.get(FormatStringsRegistry.NAME); String timeFormat = formatStringsRegistry.getFormatStringsNN(userSessionSource.getLocale()).getTimeFormat(); setFormat(timeFormat); }
@Override public void afterPropertiesSet() { UserSessionSource userSessionSource = beanLocator.get(UserSessionSource.class); Locale locale = userSessionSource.getLocale(); FormatStringsRegistry formatStringsRegistry = beanLocator.get(FormatStringsRegistry.NAME); dateField.setDateFormat(formatStringsRegistry.getFormatStringsNN(locale).getDateFormat()); dateField.setResolution(DateResolution.DAY); timeField.setTimeFormat(formatStringsRegistry.getFormatStringsNN(locale).getTimeFormat()); setResolution(Resolution.MIN); AppUI ui = AppUI.getCurrent(); if (ui != null && ui.isTestMode()) { timeField.setCubaId("timepart"); dateField.setCubaId("datepart"); } }