X-Git-Url: http://git.ieval.ro/?p=unical.git;a=blobdiff_plain;f=src%2Fro%2Fieval%2Funical%2FAddEventTabListener.java;h=364ce555738febbc01cac16e0228df7f1ba448be;hp=b38779cfd138babeff7db32598e0f491ab913bb0;hb=6521d8d80ed478b3b08608cd1b339d5d3927e0d8;hpb=c32befcc9dc90ca41784cd234ae3b9ba695cb640 diff --git a/src/ro/ieval/unical/AddEventTabListener.java b/src/ro/ieval/unical/AddEventTabListener.java index b38779c..364ce55 100644 --- a/src/ro/ieval/unical/AddEventTabListener.java +++ b/src/ro/ieval/unical/AddEventTabListener.java @@ -5,6 +5,10 @@ import android.app.ActionBar.Tab; import android.app.Fragment; import android.app.FragmentTransaction; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Date; + public class AddEventTabListener implements ActionBar.TabListener { public Fragment fragment; private Event ev; @@ -26,6 +30,19 @@ public class AddEventTabListener implements ActionBar.TabListener { switch (tabId) { case 0: ev.title=fragment.getView().findViewById(R.id.eventtitle).toString(); + String start=fragment.getView().findViewById(R.id.date_start).toString()+ " " + + fragment.getView().findViewById(R.id.time_start).toString(); + String end=fragment.getView().findViewById(R.id.date_end).toString()+ " " + + fragment.getView().findViewById(R.id.time_end).toString(); + try { + Date s=new SimpleDateFormat("yyyy-MM-dd HH:mm").parse(start); + Date e=new SimpleDateFormat("yyyy-MM-dd HH:mm").parse(end); + ev.dtstart=s.getTime(); + ev.dtend=s.getTime(); + } catch (ParseException e) { + e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates. + } + break; case 1: ev.description=fragment.getView().findViewById(R.id.description).toString();