Riesim problem s validaciou datumu a jeho nasledneho vyparsovanie do typu Date.
Lenze vzdy ked tam vlozim sucasny cas s mojim patternom (nacitavany z GUI) tak sa lisi (aj ked nie moc, mozno o par dni ;) ) od skutocneho sucasneho casu.
cast zdrojaka:
p.s.: tunTheTime je metoda ktora vracia cislo dvojciferne (3 =>03, 9 =>09, 45=>45), aby sedelo do patternu
try {
SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMddHHmm");
String dayTun = tunTheTime(day.getText());
String monthTun = tunTheTime(month.getText());
String hourTun = tunTheTime(hour.getText());
String minuteTun = tunTheTime(minute.getText());
Date dateObject = formatter.parse(year.getText() + monthTun + dayTun + hourTun + minuteTun);
String s=formatter.format(dateObject);
time = dateObject.getTime(); //vysledny cas
} catch (Exception e) {
Main.exceptionWindow(e.getMessage());
}