]> iEval git - unical.git/blob - src/ro/ieval/unical/DatePickerFragment.java
719fe372a491dd71e696315f0d63cf1a5e2f2f41
[unical.git] / src / ro / ieval / unical / DatePickerFragment.java
1 package ro.ieval.unical;
2
3 import java.text.SimpleDateFormat;
4 import java.util.GregorianCalendar;
5
6 import android.app.Activity;
7 import android.app.DatePickerDialog;
8 import android.app.DatePickerDialog.OnDateSetListener;
9 import android.app.Dialog;
10 import android.app.DialogFragment;
11 import android.os.Bundle;
12 import android.view.View;
13 import android.webkit.WebView.FindListener;
14 import android.widget.DatePicker;
15 import android.widget.EditText;
16
17 public class DatePickerFragment extends DialogFragment
18 implements OnDateSetListener {
19
20 @Override
21 public Dialog onCreateDialog(Bundle savedInstanceState) {
22 // Use the current time as the default values for the picker
23 final GregorianCalendar c = (GregorianCalendar) GregorianCalendar.getInstance();
24 int year = c.get(GregorianCalendar.YEAR);
25 int month = c.get(GregorianCalendar.MONTH);
26 int day = c.get(GregorianCalendar.DAY_OF_MONTH);
27
28 // Create a new instance of TimePickerDialog and return it
29 return new DatePickerDialog(getActivity(), this, year, month, day);
30 }
31 @Override
32 public void onDateSet(DatePicker picker, int year, int month, int day) {
33 if(picker.getId()==R.id.date_start) {
34 //EditText ds = (EditText) a.findViewById(R.id.date_start);
35 //EditText de = (EditText) a.findViewById(R.id.date_end);
36 //ds.setText(String.format("%d-%d-%d", year,month,day));
37 //de.setText(String.format("%d-%d-%d", year,month,day));
38 }else {
39 //EditText de = (EditText) a.findViewById(R.id.date_end);
40 //de.setText(String.format("%d-%d-%d", year,month,day));
41 }
42 }
43 }
This page took 0.043816 seconds and 4 git commands to generate.