Mercurial > dive4elements > river
comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/fixation/FixPeriodPanel.java @ 2892:ad013995e410
Fixed creation of initial date string in fixings parameters.
flys-client/trunk@4583 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Tue, 05 Jun 2012 13:18:07 +0000 |
parents | bd16493cc0da |
children | 0de61fc9d281 |
comparison
equal
deleted
inserted
replaced
2891:984a9ad71935 | 2892:ad013995e410 |
---|---|
1 package de.intevation.flys.client.client.ui.fixation; | 1 package de.intevation.flys.client.client.ui.fixation; |
2 | 2 |
3 import java.util.List; | 3 import java.util.List; |
4 import java.util.ArrayList; | 4 import java.util.ArrayList; |
5 import java.util.Date; | 5 import java.util.Date; |
6 import java.text.DateFormat; | |
7 import java.text.ParseException; | |
8 | 6 |
9 import com.google.gwt.core.client.GWT; | 7 import com.google.gwt.core.client.GWT; |
10 import com.google.gwt.i18n.client.DateTimeFormat; | 8 import com.google.gwt.i18n.client.DateTimeFormat; |
11 import com.google.gwt.i18n.client.DateTimeFormat.PredefinedFormat; | 9 import com.google.gwt.i18n.client.DateTimeFormat.PredefinedFormat; |
12 | 10 |
173 } | 171 } |
174 | 172 |
175 | 173 |
176 public void success() { | 174 public void success() { |
177 List<FixEvent> list = fixInfo.getEvents(); | 175 List<FixEvent> list = fixInfo.getEvents(); |
178 DateFormat df = DateFormat.getDateInstance(); | 176 DateTimeFormat df = DateTimeFormat.getFormat( |
177 DateTimeFormat.PredefinedFormat.DATE_MEDIUM); | |
178 | |
179 try { | 179 try { |
180 Date f = df.parse(list.get(0).getDate()); | 180 Date f = df.parse(list.get(0).getDate()); |
181 Date t = df.parse(list.get(list.size() - 1).getDate()); | 181 Date t = df.parse(list.get(list.size() - 1).getDate()); |
182 this.inputPanel.setFromDate(f); | 182 this.inputPanel.setFromDate(f); |
183 this.inputPanel.setToDate(t); | 183 this.inputPanel.setToDate(t); |
184 } | 184 } |
185 catch(ParseException pe) { | 185 catch(IllegalArgumentException pe) { |
186 GWT.log(pe.toString()); | 186 GWT.log(pe.toString()); |
187 } | 187 } |
188 } | 188 } |
189 | 189 |
190 protected boolean saveDateValues() { | 190 protected boolean saveDateValues() { |