Skip to content
Snippets Groups Projects
Commit 3bff945c authored by Arthur Coolen's avatar Arthur Coolen
Browse files

BugID: 604

now time needs a GMT conversion
parent 7aa995bc
No related branches found
No related tags found
No related merge requests found
...@@ -21,11 +21,13 @@ ...@@ -21,11 +21,13 @@
package nl.astron.lofar.sas.otbcomponents; package nl.astron.lofar.sas.otbcomponents;
import java.rmi.RemoteException; import java.rmi.RemoteException;
import java.text.DateFormat;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Calendar; import java.util.Calendar;
import java.util.Date; import java.util.Date;
import java.util.Iterator; import java.util.Iterator;
import java.util.TimeZone;
import java.util.TreeMap; import java.util.TreeMap;
import javax.swing.DefaultComboBoxModel; import javax.swing.DefaultComboBoxModel;
import javax.swing.JOptionPane; import javax.swing.JOptionPane;
...@@ -186,9 +188,19 @@ public class TreeInfoDialog extends javax.swing.JDialog { ...@@ -186,9 +188,19 @@ public class TreeInfoDialog extends javax.swing.JDialog {
Calendar cal = Calendar.getInstance(); Calendar cal = Calendar.getInstance();
cal.setTime(now); cal.setTime(now);
cal.set(Calendar.MINUTE,cal.get(Calendar.MINUTE)+4); cal.set(Calendar.MINUTE,cal.get(Calendar.MINUTE)+4);
Date minTime = cal.getTime(); DateFormat idf = new SimpleDateFormat("yyyy-MMM-d HH:mm:ss");
DateFormat odf = new SimpleDateFormat("yyyy-MMM-d HH:mm:ss");
odf.setTimeZone(TimeZone.getTimeZone("GMT"));
String aGMTTime = odf.format(cal.getTime());
Date minTime = null;
try {
minTime = idf.parse(aGMTTime);
} catch (ParseException ex) {
logger.debug("Error converting date string: " + aGMTTime);
return false;
}
if (itsStartDate.before(minTime)) { if (itsStartDate.before(minTime)) {
anErrorMsg = "Start time needs to be minimal 4 minutes away from now"; anErrorMsg = "Start time needs to be minimal 4 minutes away from now (GMT)";
} }
if (itsStopDate.before(itsStartDate)) { if (itsStopDate.before(itsStartDate)) {
if (anErrorMsg.length() > 0) { if (anErrorMsg.length() > 0) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment