Subversion Repositories eFlore/Applications.coel

Rev

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

Rev 1193 Rev 1284
Line 4... Line 4...
4
import java.util.Iterator;
4
import java.util.Iterator;
5
import java.util.Set;
5
import java.util.Set;
Line 6... Line 6...
6
 
6
 
7
import org.tela_botanica.client.modeles.aDonnee;
7
import org.tela_botanica.client.modeles.aDonnee;
-
 
8
import org.tela_botanica.client.modeles.personne.Personne;
Line 8... Line 9...
8
import org.tela_botanica.client.modeles.personne.Personne;
9
import org.tela_botanica.client.util.UtilString;
9
 
10
 
10
import com.extjs.gxt.ui.client.data.BaseModelData;
11
import com.extjs.gxt.ui.client.data.BaseModelData;
Line 164... Line 165...
164
		if (dateFondation != null) {
165
		if (dateFondation != null) {
165
			dateFormatee = DateTimeFormat.getLongDateFormat().format(dateFondation);
166
			dateFormatee = DateTimeFormat.getLongDateFormat().format(dateFondation);
166
		}
167
		}
167
		return dateFormatee;
168
		return dateFormatee;
168
	}
169
	}
-
 
170
	
-
 
171
	public String getAnneOuDateFondationFormatLong() {
-
 
172
		String dateFormatee = "";
-
 
173
		String dateFondation =  renvoyerValeurCorrecte("date_fondation");
-
 
174
		if (!dateFondation.equals(""))	{
-
 
175
			if (dateFondation.endsWith("00-00"))	{
-
 
176
			dateFormatee = dateFondation.substring(0, 4);
-
 
177
			} else {
-
 
178
				Date date = DateTimeFormat.getFormat("yyyy-MM-dd").parse(dateFondation);
-
 
179
				dateFormatee = DateTimeFormat.getLongDateFormat().format(date);
-
 
180
			}
-
 
181
		}
-
 
182
		return dateFormatee;
-
 
183
	}
169
	public Date getDateFondation() {
184
	public Date getDateFondation() {
170
		Date fondationDate = null;
185
		Date fondationDate = null;
171
		String fondationChaine = renvoyerValeurCorrecte("date_fondation");
186
		String fondationChaine = renvoyerValeurCorrecte("date_fondation");
172
		if (!fondationChaine.isEmpty() && !fondationChaine.equals("0000-00-00")) {
187
		if (!fondationChaine.isEmpty() && !fondationChaine.equals("0000-00-00")) {
173
			fondationDate = DateTimeFormat.getFormat("yyyy-MM-dd").parseStrict(fondationChaine);
188
			fondationDate = DateTimeFormat.getFormat("yyyy-MM-dd").parseStrict(fondationChaine);
174
		}
189
		}
175
		return fondationDate;
190
		return fondationDate;
176
	}
191
	}
-
 
192
	
-
 
193
	public String getAnneeOuDateFondation()	{
-
 
194
		 String valeurDateFondation = get("date_fondation");
-
 
195
		 if (!UtilString.isEmpty(valeurDateFondation) && valeurDateFondation.endsWith("00-00")) {
-
 
196
			 valeurDateFondation = valeurDateFondation.substring(0, 4);
-
 
197
		 } else if (UtilString.isEmpty(valeurDateFondation) && valeurDateFondation.equals("0000-00-00")) {
-
 
198
			 valeurDateFondation  = "";
-
 
199
		 }
-
 
200
		 return valeurDateFondation;
-
 
201
	}
-
 
202
	
177
	public void setDateFondation(Date dateFondation) {
203
	public void setDateFondation(Date dateFondation) {
178
		if (dateFondation != null) {
204
		if (dateFondation != null) {
179
			this.set("date_fondation", DateTimeFormat.getFormat("yyyy-MM-dd").format(dateFondation));
205
			this.set("date_fondation", DateTimeFormat.getFormat("yyyy-MM-dd").format(dateFondation));
180
		}
206
		}
181
	}
207
	}