import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Calendar;
+import java.util.Date;
import java.util.GregorianCalendar;
import java.util.Map;
+import java.util.TimeZone;
import javax.servlet.http.HttpServletRequest;
private String[] names;
+ public DateSelector(String day, String month, String year, Date date) {
+ this(day, month, year);
+ Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("UTF"));
+ cal.setTime(date);
+ this.day = cal.get(Calendar.DAY_OF_MONTH);
+ this.month = cal.get(Calendar.MONTH);
+ this.year = cal.get(Calendar.YEAR);
+ }
+
public DateSelector(String day, String month, String year) {
this.names = new String[] {
day, month, year
package org.cacert.gigi.pages.account;
-import static org.cacert.gigi.Gigi.USER;
+import static org.cacert.gigi.Gigi.*;
import java.io.IOException;
import java.io.PrintWriter;
map.put("mname", u.getMname() == null ? "" : HTMLEncoder.encodeHTML(u.getMname()));
map.put("lname", HTMLEncoder.encodeHTML(u.getLname()));
map.put("suffix", u.getSuffix() == null ? "" : HTMLEncoder.encodeHTML(u.getSuffix()));
- DateSelector ds = new DateSelector("day", "month", "year");
+ DateSelector ds = new DateSelector("day", "month", "year", u.getDob());
map.put("DoB", ds);
map.put("details", "");
getDefaultTemplate().output(out, getLanguage(req), map);