Example usage for java.util Locale FRANCE

List of usage examples for java.util Locale FRANCE

Introduction

In this page you can find the example usage for java.util Locale FRANCE.

Prototype

Locale FRANCE

To view the source code for java.util Locale FRANCE.

Click Source Link

Document

Useful constant for country.

Usage

From source file:fr.bde_eseo.eseomega.events.EventItem.java

public void setDateAsString(String dateAsString, String dateAsStringEnd) {
    SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.FRANCE);
    Date date = null;/*from  w w  w  . j  a  v a  2  s  . c o  m*/
    Date datefin = null;
    try {
        date = format.parse(dateAsString);
        datefin = format.parse(dateAsStringEnd);
    } catch (ParseException e) {
        e.printStackTrace();
    }
    this.datefin = datefin;
    this.date = date;
}

From source file:org.jfree.data.time.WeekTest.java

/**
 * The 53rd week in 2004 in London and Paris should span the range:
 *
 * TimeZone         | Start Millis  | End Millis    | Start Date  | End Date
 * -----------------+---------------+---------------+-------------+------------
 * Europe/London    | 1104105600000 | 1104710399999 | 27-Dec-2004 | 02-Jan-2005
 * Europe/Paris     | 1104102000000 | 1104706799999 | 27-Dec-2004 | 02-Jan-2005
 *
 * The 53rd week in 2005 in New York should span the range:
 *
 * TimeZone         | Start Millis  | End Millis    | Start Date  | End Date
 * -----------------+---------------+---------------+-------------+------------
 * America/New_York | 1135486800000 | 1136091599999 | 25-Dec-2005 | 31-Dec-2005
 *
 * In London and Paris, Monday is the first day of the week, while in the
 * US it is Sunday./*from   w  ww. j av a  2s  .  c om*/
 */
@Test
public void testWeek532005() {
    Week w1 = new Week(53, 2004);
    Calendar c1 = Calendar.getInstance(TimeZone.getTimeZone("Europe/London"), Locale.UK);
    c1.setMinimalDaysInFirstWeek(4); // see Java Bug ID 4960215
    assertEquals(1104105600000L, w1.getFirstMillisecond(c1));
    assertEquals(1104710399999L, w1.getLastMillisecond(c1));
    Calendar c2 = Calendar.getInstance(TimeZone.getTimeZone("Europe/Paris"), Locale.FRANCE);
    c2.setMinimalDaysInFirstWeek(4); // see Java Bug ID 4960215
    assertEquals(1104102000000L, w1.getFirstMillisecond(c2));
    assertEquals(1104706799999L, w1.getLastMillisecond(c2));
    w1 = new Week(53, 2005);
    Calendar c3 = Calendar.getInstance(TimeZone.getTimeZone("America/New_York"), Locale.US);
    assertEquals(1135486800000L, w1.getFirstMillisecond(c3));
    assertEquals(1136091599999L, w1.getLastMillisecond(c3));
}

From source file:fr.bde_eseo.eseomega.events.EventItem.java

public String getDayAsString(Date d) {
    SimpleDateFormat sdf = new SimpleDateFormat("EEEE dd MMM", Locale.FRANCE);
    String sDate = sdf.format(d);
    if (sDate.equals(HOUR_PASS_ALLDAY))
        sDate = "";
    return sDate;
}

From source file:fr.bde_eseo.eseomega.events.EventItem.java

public String getDayNumero() {
    SimpleDateFormat sdf = new SimpleDateFormat("dd", Locale.FRANCE);
    return sdf.format(this.date);
}

From source file:fr.bde_eseo.eseomega.events.EventItem.java

public String getDayName() {
    SimpleDateFormat sdf = new SimpleDateFormat("EEEE", Locale.FRANCE);
    return sdf.format(this.date);
}

From source file:xml.sk.Parser.java

/**
 * Parses EducationSk.xml./*www  . ja  v a2 s .c  o  m*/
 *
 * @param manager education manager to store data
 * @throws javax.xml.parsers.ParserConfigurationException
 * @throws org.xml.sax.SAXException
 * @throws java.io.IOException
 */
public void parseEducationSk(EducationManagerImpl manager) throws ParserConfigurationException, SAXException,
        IOException, XPathExpressionException, ParseException {
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    DocumentBuilder builder = factory.newDocumentBuilder();
    Document doc = builder.parse("src/main/java/xml/sk/EducationSk.xml");

    NodeList educationList = doc.getElementsByTagName("PRAC_strMzdyVzdelanie");
    for (int i = 0; i < educationList.getLength(); i++) {
        Element educationNode = (Element) educationList.item(i);

        if (!"EUR".equals(educationNode.getElementsByTagName("MJ").item(0).getTextContent()))
            continue;

        String name = educationNode.getElementsByTagName("UKAZ2").item(0).getTextContent();
        String sex = educationNode.getElementsByTagName("UKAZ1").item(0).getTextContent();
        String[] splited = sex.split(" ");
        sex = splited[splited.length - 1];

        NodeList years = educationNode.getChildNodes();

        for (int j = 0; j < years.getLength(); j++) {
            if (years.item(j).getNodeType() == Node.TEXT_NODE) {
                continue;
            }
            Element yearNode = (Element) years.item(j);
            if ("MJ".equals(yearNode.getNodeName()) || "UKAZ".equals(yearNode.getNodeName().substring(0, 4)))
                continue;

            String year = yearNode.getNodeName().substring(1);
            if (".".equals(yearNode.getTextContent()) || "".equals(yearNode.getTextContent())) {
                continue;
            }
            String salaryStr = yearNode.getTextContent().replaceAll(" ", "");
            NumberFormat format = NumberFormat.getInstance(Locale.FRANCE);
            Number number = format.parse(salaryStr);
            double salaryDouble = number.doubleValue();

            Education education = new Education();
            education.setDegree(name);
            education.setCountry("sk");
            education.setYear(year);
            education.setAverageSalary(salaryDouble);
            if (!"spolu".equals(sex))
                education.setSex(sex);

            manager.createEducation(education);
        }
    }
}

From source file:org.ocelotds.marshalling.ArgumentServicesTest.java

@Test
public void testGetJavaResultFromSpecificUnmarshallerMap() throws JsonUnmarshallingException {
    System.out.println("getJavaResultFromSpecificUnmarshallerMap");
    LocaleMarshaller lm = new LocaleMarshaller();
    String json = "{\"KEY1\":{\"country\":\"FR\",\"language\":\"fr\"},\"KEY2\":{\"country\":\"US\",\"language\":\"en\"}}";
    Map result = instance.getJavaResultFromSpecificUnmarshallerMap(json, lm);
    assertThat(result).hasSize(2);//from w ww  . ja v a  2s . c  om
    assertThat(result.get("KEY1")).isEqualTo(Locale.FRANCE);
    assertThat(result.get("KEY2")).isEqualTo(Locale.US);
}

From source file:fr.paris.lutece.portal.web.admin.AdminPageJspBeanTest.java

public void testDoRemovePageWithChild() throws AccessDeniedException {
    String childPageName = _randomPageName + "-child";
    Page childPage = null;// w w w  .  j a  v a2  s.c o  m
    IPageService pageService = (IPageService) SpringContextService.getBean("pageService");
    try {
        childPage = new Page();
        childPage.setParentPageId(_page.getId());
        childPage.setPageTemplateId(PageTemplateHome.getPageTemplatesList().get(0).getId());
        childPage.setName(childPageName);
        pageService.createPage(childPage);
        MockHttpServletRequest request = new MockHttpServletRequest();
        request.addParameter(Parameters.PAGE_ID, Integer.toString(_page.getId()));
        _bean.doRemovePage(request);
        AdminMessage message = AdminMessageService.getMessage(request);
        assertNotNull(message);
        assertEquals(AdminMessage.TYPE_STOP, message.getType());
        ReferenceList listLanguages = I18nService.getAdminLocales(Locale.FRANCE);
        for (ReferenceItem lang : listLanguages) {
            assertTrue(message.getText(new Locale(lang.getCode())).contains(_randomPageName));
        }
    } finally {
        if (childPage != null) {
            try {
                pageService.removePage(childPage.getId());
            } finally {
            }
        }
    }
}

From source file:com.orange.ocara.ui.activity.ResultAuditActivity.java

private void updateDetails(Audit audit) {
    final DateFormat dateFormat = new SimpleDateFormat("EEEE d MMMM yyyy", Locale.FRANCE);

    auditName.setText(audit.getName());/*from w  ww  .  j  av a 2s  .  c  o  m*/
    auditType.setText(audit.getRuleSet().getType());
    auditDate.setText(dateFormat.format(audit.getDate()));
    auditUser.setText(AuditorAutoCompleteView.format(audit.getAuthor()));
    auditSite.setText(SiteAutoCompleteView.format(audit.getSite(), false));

    updateChart(audit);
}

From source file:io.jawg.osmcontributor.ui.activities.PhotoActivity.java

private File createImageFile() throws IOException {
    // Create an image file name
    String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss", Locale.FRANCE).format(new Date());
    String imageFileName = "JPEG_" + timeStamp + "_";
    File storageDir = getExternalFilesDir(Environment.DIRECTORY_PICTURES);
    return File.createTempFile(imageFileName, ".jpg", storageDir);
}