1 package ro
.ieval
.unical
;
3 import java
.text
.SimpleDateFormat
;
4 import java
.util
.GregorianCalendar
;
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
;
17 public class DatePickerFragment
extends DialogFragment
18 implements OnDateSetListener
{
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
);
28 // Create a new instance of TimePickerDialog and return it
29 return new DatePickerDialog(getActivity(), this, year
, month
, day
);
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));
39 //EditText de = (EditText) a.findViewById(R.id.date_end);
40 //de.setText(String.format("%d-%d-%d", year,month,day));