Subversion Repositories eFlore/Applications.cel

Rev

Rev 1010 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1010 Rev 1282
Line 1... Line 1...
1
package org.tela_botanica.client.util;
1
package org.tela_botanica.client.util;
Line 2... Line 2...
2
 
2
 
Line -... Line 3...
-
 
3
import org.tela_botanica.client.modeles.objets.Observation;
-
 
4
 
-
 
5
import com.google.gwt.json.client.JSONObject;
3
import org.tela_botanica.client.modeles.objets.Observation;
6
import com.google.gwt.json.client.JSONString;
Line 4... Line 7...
4
 
7
 
5
public class Util {
8
public class Util {
Line -... Line 9...
-
 
9
 
-
 
10
	public Util() {
-
 
11
	}
-
 
12
	
-
 
13
	public static String getValeurJsonOuVide(JSONObject jo, String index) {
-
 
14
		return jsonNonNull(jo, index) ? ((JSONString)jo.get(index)).stringValue() : "";
-
 
15
	}
-
 
16
	
-
 
17
	public static boolean jsonNonNull(JSONObject jo, String index) {
-
 
18
		return (jo != null && 
-
 
19
				jo.get(index) != null && 
6
 
20
				jo.get(index).isNull() == null
Line 7... Line 21...
7
	public Util() {
21
			   );			
Line 8... Line 22...
8
	}
22
	}
Line 147... Line 161...
147
		String[] tabDate = dateRemplacee.split("/");
161
		String[] tabDate = dateRemplacee.split("/");
Line 148... Line 162...
148
		
162
		
Line 149... Line 163...
149
		boolean retour = false;
163
		boolean retour = false;
-
 
164
		
-
 
165
		if(tabDate.length == 3) {
-
 
166
			//TODO: faire un parsing de date qui fonctionne mieux car 
150
		
167
			// on peut saisir un 31 novembre par exemple
151
		if(tabDate.length == 3) {
168
			// mais l'api date de java est mal gérée par gwt
152
			try {
169
			try {
153
				int jour = Integer.parseInt(tabDate[0]);
170
				int jour = Integer.parseInt(tabDate[0]);