Postingan lainnya
Cara disable tanggal kemarin
misi gan, ane pengen nanya..
final Calendar today = Calendar.getInstance();
final DatePickerDialog.OnDateSetListener date = new DatePickerDialog.OnDateSetListener(){
@Override
public void onDateSet(DatePicker datePicker, int year, int monthOfYear, int dayOfMonth) {
today.set(Calendar.YEAR, year);
today.set(Calendar.MONTH, monthOfYear);
today.set(Calendar.DAY_OF_MONTH, dayOfMonth);
updateLabel();
}
private void updateLabel() {
String myFormat = "yyyy-MM-dd"; //In which you need put here
SimpleDateFormat sdf = new SimpleDateFormat(myFormat, Locale.US);
editText.setText(sdf.format(today.getTime()));
}
};
editText.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
new DatePickerDialog(sakit.this, date, today
.get(Calendar.YEAR), today.get(Calendar.MONTH),
today.get(Calendar.DAY_OF_MONTH)).show();
}
});
kalo mau disable tanggal kemarin misalkan -3 cara nya gimana gan ?
0
Belum ada Jawaban. Jadi yang pertama Jawaban
Login untuk ikut Jawaban