List of usage examples for java.util Locale UK
Locale UK
To view the source code for java.util Locale UK.
Click Source Link
From source file:Main.java
public static String toSimpleDateTime(Date date) { DateFormat df = new SimpleDateFormat(simpleDateString, Locale.UK); df.setTimeZone(TimeZone.getTimeZone("UTC")); return df.format(date); }
From source file:com.appjma.appdeployer.service.Parser.java
public Parser(ParserResult parserResult) { mParserResult = parserResult; mDateFormat = new SimpleDateFormat("MMM F, y h:m:s a", Locale.UK); }
From source file:calendar.services.transformers.EntryToDayTransformer.java
@Override public DaySummary transform(List<Entry> entryList) { BigDecimal total = new BigDecimal(0); Calendar cal = Calendar.getInstance(); cal.setTime(this.date); if (!entryList.isEmpty()) { daySummary.setEntries(entryList); total = entryList.stream().map((x) -> x.getHours()).reduce((x, y) -> x.add(y)).get(); }/* w ww .j a v a 2 s . c om*/ daySummary.setDay(cal.getDisplayName(Calendar.DAY_OF_WEEK, Calendar.SHORT, Locale.UK)); daySummary.setTotal(total); return daySummary; }
From source file:ru.xxlabaza.popa.template.TemplaterGroovy.java
@Override protected void lazyInitialization() throws Exception { TemplateConfiguration configuration = new TemplateConfiguration(); configuration.setUseDoubleQuotes(true); configuration.setAutoIndent(true);/*w ww .j a va 2s. c o m*/ configuration.setAutoNewLine(true); configuration.setLocale(Locale.UK); engine = new MarkupTemplateEngine(configuration); templatesFolder = appProperties.getFolder().getTemplates().toAbsolutePath(); }
From source file:org.openstreetmap.josm.plugins.mapillary.utils.MapillaryUtils.java
/** * Returns the current date formatted as EXIF timestamp. * As timezone the default timezone of the JVM is used ({@link java.util.TimeZone#getDefault()}). * * @return A {@code String} object containing the current date. *///from www. ja va 2 s. c o m public static String currentDate() { return new SimpleDateFormat("yyyy:MM:dd HH:mm:ss", Locale.UK).format(Calendar.getInstance().getTime()); }
From source file:com.google.android.apps.mytracks.fragments.CheckUnitsDialogFragment.java
@Override public Dialog onCreateDialog(Bundle savedInstanceState) { Locale defaultLocale = Locale.getDefault(); boolean defaultMetric = !defaultLocale.equals(Locale.US) && !defaultLocale.equals(Locale.UK); PreferencesUtils.setBoolean(getActivity(), R.string.metric_units_key, defaultMetric); final String metric = getString(R.string.settings_stats_units_metric); final String imperial = getString(R.string.settings_stats_units_imperial); final CharSequence[] items = defaultMetric ? new CharSequence[] { metric, imperial } : new CharSequence[] { imperial, metric }; return new AlertDialog.Builder(getActivity()) .setPositiveButton(R.string.generic_ok, new DialogInterface.OnClickListener() { @Override// w w w.ja v a 2 s.co m public void onClick(DialogInterface dialog, int which) { int position = ((AlertDialog) dialog).getListView().getCheckedItemPosition(); PreferencesUtils.setBoolean(getActivity(), R.string.metric_units_key, items[position].equals(metric)); onDone(); } }).setSingleChoiceItems(items, 0, null).setTitle(R.string.settings_stats_units_title).create(); }
From source file:test.pl.chilldev.facelets.taglib.spring.web.MessageTagTest.java
@Test public void apply() throws FacesException { String message = "Foo"; String var = "bar"; Locale locale = Locale.UK; String translated = "Baz"; Map<String, Object> config = new HashMap<>(); config.put(MessageTag.ATTRIBUTE_MESSAGE, message); config.put(MessageTag.ATTRIBUTE_VAR, var); MessageTag tag = new MessageTag(MockTagConfig.factory(config)); // set up context FaceletContext context = new MockFaceletContext(); context.getFacesContext().getExternalContext().getApplicationMap() .put(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE, this.applicationContext); context.setLocale(locale);/*from w ww . j ava 2s . c o m*/ when(this.applicationContext.getBean(MessageSource.class)).thenReturn(this.messageSource); when(this.messageSource.getMessage(message, null, locale)).thenReturn(translated); // run the tag tag.apply(context, this.parent); assertEquals("MessageTag.apply() should translate message using current locale by default.", translated, context.getAttribute(var)); }
From source file:com.nabla.wapp.server.general.UserSession.java
public UserSession(final Integer userId, boolean isRoot, final String locale) { this.userId = userId; this.isRoot = isRoot; try {// w w w. j a va 2s.c o m this.locale = LocaleUtils.toLocale(locale); } catch (IllegalArgumentException __) { if (log.isErrorEnabled()) log.error("unsupported locale '" + locale + "'"); this.locale = Locale.UK; } this.sessionId = UUID.randomUUID().toString(); }
From source file:org.pdfsam.ui.dashboard.preference.PreferencePaneTest.java
@BeforeClass public static void setUp() { eventStudio().broadcast(new SetLocaleEvent(Locale.UK.toLanguageTag())); }
From source file:org.mifos.framework.util.helpers.DateUtils.java
public static void refreshInternalLocale() { internalLocale = Locale.UK; }