diff --git a/app/src/main/java/com/example/citrusclient/views/CreateScheduleFragment.java b/app/src/main/java/com/example/citrusclient/views/CreateScheduleFragment.java index 5c566b5..f1b010d 100644 --- a/app/src/main/java/com/example/citrusclient/views/CreateScheduleFragment.java +++ b/app/src/main/java/com/example/citrusclient/views/CreateScheduleFragment.java @@ -188,10 +188,10 @@ DatePickerDialog datePickerDialog = new DatePickerDialog(requireContext(), new DatePickerDialog.OnDateSetListener() { @Override public void onDateSet(DatePicker view, int year, int month, int dayOfMonth) { - String date = year + "/" + String.format("%02d", (month + 1)) + "/" + String.format("%02d", dayOfMonth); + String date = year + "/" + String.format("%02d", (month+1)) + "/" + String.format("%02d", dayOfMonth); startDateButton.setText(date); } - }, viwStartYear, viwStartMonth, viwStartDay); + }, viwStartYear, viwStartMonth-1, viwStartDay); datePickerDialog.show(); }); startTimeButton.setOnClickListener(v -> { @@ -208,10 +208,10 @@ DatePickerDialog datePickerDialog = new DatePickerDialog(requireContext(), new DatePickerDialog.OnDateSetListener() { @Override public void onDateSet(DatePicker view, int year, int month, int dayOfMonth) { - String date = year + "/" + String.format("%02d", (month + 1)) + "/" + String.format("%02d", dayOfMonth); + String date = year + "/" + String.format("%02d", (month+1)) + "/" + String.format("%02d", dayOfMonth); endDateButton.setText(date); } - }, viwEndYear, viwEndMonth, viwEndDay); + }, viwEndYear, viwEndMonth-1, viwEndDay); datePickerDialog.show(); }); endTimeButton.setOnClickListener(v -> {