Back to project page AndroIUT.
The source code is released under:
GNU General Public License
If you think the Android project AndroIUT listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.iutdijon.androiut2.schooling.data; // ww w .jav a2 s. c o m import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; /** * Classe abstraite servant de base ? toutes donn?es li?es ? la scolarit? d'un ?tudiant * @author Morgan Funtowicz * */ public abstract class SchoolingData { private static SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd", Locale.FRENCH); protected String date; public SchoolingData(String date) { this.date = date; } public String getDate(){ return date; } @Override public String toString() { Date d; String result = ""; try { d = formatter.parse(date); result += DateFormat.getDateInstance(DateFormat.MEDIUM, Locale.FRENCH).format(d); } catch (ParseException e) { e.printStackTrace(); return "<b><u>"+ date + "</u></b> "; } return "<b><u>"+ result+ "</u></b> "; } }