Subversion Repositories eFlore/Applications.cel

Compare Revisions

Ignore whitespace Rev 1281 → Rev 1282

/trunk/src/org/tela_botanica/client/util/Util.java
2,11 → 2,25
 
import org.tela_botanica.client.modeles.objets.Observation;
 
import com.google.gwt.json.client.JSONObject;
import com.google.gwt.json.client.JSONString;
 
public class Util {
 
public Util() {
}
public static String getValeurJsonOuVide(JSONObject jo, String index) {
return jsonNonNull(jo, index) ? ((JSONString)jo.get(index)).stringValue() : "";
}
public static boolean jsonNonNull(JSONObject jo, String index) {
return (jo != null &&
jo.get(index) != null &&
jo.get(index).isNull() == null
);
}
public static String formaterLieu(Observation obs, String modeleLieu) {
String lieuModele = modeleLieu;
149,6 → 163,9
boolean retour = false;
if(tabDate.length == 3) {
//TODO: faire un parsing de date qui fonctionne mieux car
// on peut saisir un 31 novembre par exemple
// mais l'api date de java est mal gérée par gwt
try {
int jour = Integer.parseInt(tabDate[0]);
int mois = Integer.parseInt(tabDate[1]);