- final TextView startday= (TextView) findViewById(R.id.startday);
- final TextView endday= (TextView) findViewById(R.id.endday);
- final TextView startdate= (TextView) findViewById(R.id.startdate);
- final TextView enddate= (TextView) findViewById(R.id.enddate);
- final TextView starttime= (TextView) findViewById(R.id.starttime);
- final TextView endtime= (TextView) findViewById(R.id.endtime);
-
- GregorianCalendar cstart = new GregorianCalendar();
- cstart.setTime(new Date(e.dtstart));
- GregorianCalendar cend = new GregorianCalendar();
- cend.setTime(new Date(e.dtend));
- SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy");
- SimpleDateFormat stf = new SimpleDateFormat("kk:mm:ss");
-
- startday.setText(CalendarUtils.DayToString(this,cstart));
- if(CalendarUtils.DayToString(this,cstart)!=CalendarUtils.DayToString(this, cend))
- endday.setText(CalendarUtils.DayToString(this, cend));
- startdate.setText(sdf.format(cstart.getTime()));
- if(sdf.format(cstart.getTime())!=sdf.format(cend.getTime()))
- enddate.setText(sdf.format(cend.getTime()));
- starttime.setText(stf.format(cstart.getTime()));
- endtime.setText(stf.format(cend.getTime()));
+ final TextView startDay= (TextView) findViewById(R.id.startday);
+ final TextView endDay= (TextView) findViewById(R.id.endday);
+ final TextView startDate= (TextView) findViewById(R.id.startdate);
+ final TextView endDate= (TextView) findViewById(R.id.enddate);
+ final TextView startTime= (TextView) findViewById(R.id.starttime);
+ final TextView endTime= (TextView) findViewById(R.id.endtime);
+
+ final Date start=new Date(e.dtstart);
+ final Date end=new Date(e.dtend);
+ final SimpleDateFormat dateFormat = new SimpleDateFormat("MM/dd/yyyy", Locale.UK);
+ final SimpleDateFormat timeFormat = new SimpleDateFormat("HH:mm:ss", Locale.UK);
+ final SimpleDateFormat dayOfWeekFormat = new SimpleDateFormat("E", Locale.UK);
+
+ startDay.setText(dayOfWeekFormat.format(start));
+ if(dayOfWeekFormat.format(start)!=dayOfWeekFormat.format(end))
+ endDay.setText(dayOfWeekFormat.format(end));
+ startDate.setText(dateFormat.format(start));
+ if(dateFormat.format(start)!=dateFormat.format(end))
+ endDate.setText(dateFormat.format(end));
+ startTime.setText(timeFormat.format(start));
+ endTime.setText(timeFormat.format(end));