Example usage for org.joda.time.format DateTimeFormat mediumDate

List of usage examples for org.joda.time.format DateTimeFormat mediumDate

Introduction

In this page you can find the example usage for org.joda.time.format DateTimeFormat mediumDate.

Prototype

public static DateTimeFormatter mediumDate() 

Source Link

Document

Creates a format that outputs a medium date format.

Usage

From source file:de.atomfrede.android.thwdroid.mission.activity.DisplayMissionDetailsActivity.java

License:Apache License

public void refresh() {
    currentMission = (Mission) getModel(missionId);

    ((TextView) findViewById(R.id.description_text_view)).setText(currentMission.getDescription());

    // mission data
    ((TextView) findViewById(R.id.mission_title)).setText(currentMission.getName());
    ((TextView) findViewById(R.id.description_text_view)).setText(currentMission.getDescription());
    ((TextView) findViewById(R.id.start_time_text_view))
            .setText(currentMission.getStartDate().toString(DateTimeFormat.mediumDate()));
    String unitCount = 0 + "";
    if (currentMission.getAvailableUnitList() != null) {
        unitCount = currentMission.getAvailableUnitList().size() + "";

    }/* w  w  w.ja  va2  s .  c  om*/
    TextView freeUnitsTv = (TextView) findViewById(R.id.units_count_text_view);
    if (freeUnitsTv != null)
        freeUnitsTv.setText(unitCount);
    // ((TextView) findViewById(R.id.units_count_text_view)).setText(unitCount);

    listAdapter = new MissionSectionListAdapter(this, currentMission.getMissionSectionList(), false);
    setListAdapter(listAdapter);

}

From source file:de.atomfrede.android.thwdroid.mission.activity.EditMissionActivity.java

License:Apache License

public void refresh() {
    currentMission = (Mission) getModel(missionId);

    // mission data
    ((EditText) findViewById(R.id.mission_title)).setText(currentMission.getName());
    ((EditText) findViewById(R.id.description_edit_text_view)).setText(currentMission.getDescription());
    ((TextView) findViewById(R.id.start_time_text_view))
            .setText(currentMission.getStartDate().toString(DateTimeFormat.mediumDate()));

    listAdapter = new MissionSectionListAdapter(this, currentMission.getMissionSectionList(), true);
    setListAdapter(listAdapter);/* w ww  .ja va 2 s  .  c om*/

}

From source file:de.dreier.mytargets.features.settings.SettingsManager.java

License:Open Source License

public static String getProfileBirthDayFormatted() {
    final LocalDate birthDay = getProfileBirthDay();
    if (birthDay == null) {
        return null;
    }//from  w  ww  . j ava 2  s  .  c  om
    return DateTimeFormat.mediumDate().print(birthDay);
}

From source file:eu.trentorise.opendata.jackan.test.ckan.CkanTestReporter.java

License:Apache License

/**
 * Formats date time up to the day, in English format
 *//* w  ww  . j  a  v  a  2 s . co m*/
private static String formatDateUpToDay(DateTime date) {
    return date.toString(DateTimeFormat.mediumDate().withLocale(Locale.ENGLISH));
}

From source file:jiajiechen.countdown.CountDownGUI.java

License:Open Source License

public static void writeToFile(String filename) {
    Preferences userData = Preferences.userNodeForPackage(CountDownGUI.class);
    if (filename.equals("") != true) {
        FileOutputStream f = null;
        try {/*from  w w w.ja va  2  s. c  o  m*/
            f = new FileOutputStream(filename);
            userData.exportNode(f);
        } catch (IOException e) {
            e.printStackTrace();
        } catch (BackingStoreException e) {
            e.printStackTrace();
        } finally {
            if (f != null) {
                try {
                    f.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }

    }
    Integer size = countdown.size();
    userData.put("items", String.valueOf(size));
    Iterator<Entry<String, DateTime>> iter = countdown.entrySet().iterator();
    Integer i = 0;
    while (iter.hasNext()) {
        Entry<String, DateTime> entry = (Entry<String, DateTime>) iter.next();
        userData.put("item" + String.valueOf(i) + "name", entry.getKey());
        userData.put("item" + String.valueOf(i) + "date", DateTimeFormat.mediumDate().print(entry.getValue()));
        i++;
    }
}

From source file:kagoyume.InsertResult.java

/**
 * Processes requests for both HTTP <code>GET</code> and <code>POST</code>
 * methods.//from ww  w  . jav a2s  . c o  m
 *
 * @param request servlet request
 * @param response servlet response
 * @throws ServletException if a servlet-specific error occurs
 * @throws IOException if an I/O error occurs
 */
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
    response.setContentType("text/html;charset=UTF-8");
    int userID = Integer.parseInt(request.getParameter("userID"));
    String name = request.getParameter("name");
    String password = request.getParameter("password");
    String mail = request.getParameter("mail");
    String address = request.getParameter("address");
    DateTime date1 = DateTime.now();
    DateTimeFormatter mediumFmt = DateTimeFormat.mediumDate();
    String date = mediumFmt.print(date1);

    try {
        UserData ud = new UserData();
        ud.setUserID(userID);
        ud.setName(name);
        ud.setPassword(password);
        ud.setMail(mail);
        ud.setAddress(address);
        ud.setTotal(0);
        ud.setNewDate(String.valueOf(date1));

    } catch (Exception e) {

    }
}

From source file:name.martingeisse.admin.application.converter.LocalDateConverter.java

License:Open Source License

/**
 * Obtains the formatter to use for the specified locale.
 *///from  ww  w  .j a  va  2  s  . co m
private static DateTimeFormatter getFormatter(Locale locale) {
    return DateTimeFormat.mediumDate().withLocale(locale);
}

From source file:net.sourceforge.atunes.utils.DateFormatter.java

License:Open Source License

/**
 * @return date formatter to use/*from   w ww .  j  a v  a 2 s  .co m*/
 */
private DateTimeFormatter getDateFormat() {
    if (this.dateFormat == null) {
        this.dateFormat = DateTimeFormat.mediumDate().withLocale(this.stateCore.getLocale().getLocale());
    }
    return this.dateFormat;
}

From source file:org.apache.isis.applib.value.Date.java

License:Apache License

public String title() {
    return DateTimeFormat.mediumDate().print(date);
}

From source file:org.efaps.esjp.accounting.transaction.evaluation.DocumentInfo_Base.java

License:Apache License

/**
 * @return Date as String//from   w  ww. jav a2  s.  co  m
 * @throws EFapsException on error
 */
public String getDateString() throws EFapsException {
    final DateTimeFormatter formatter = DateTimeFormat.mediumDate();
    return this.date.withChronology(Context.getThreadContext().getChronology())
            .toString(formatter.withLocale(Context.getThreadContext().getLocale()));
}