diff --git a/app/src/main/java/com/example/citrusclient/views/CalendarFragment.java b/app/src/main/java/com/example/citrusclient/views/CalendarFragment.java index 454fa78..10b2987 100644 --- a/app/src/main/java/com/example/citrusclient/views/CalendarFragment.java +++ b/app/src/main/java/com/example/citrusclient/views/CalendarFragment.java @@ -159,7 +159,7 @@ Button prevMonth = view.findViewById(R.id.prevMonth); FloatingActionButton createBook = view.findViewById(R.id.floatingActionButton); TextView curMonth = view.findViewById(R.id.month); - curMonth.setText("" + month + "月"); + curMonth.setText(year + "年" + "" + month + "月"); createBook.setOnClickListener(new View.OnClickListener() { @Override @@ -174,8 +174,9 @@ month++; if(month > 12){ month = 1; + year++; } - curMonth.setText("" + month + "月"); + curMonth.setText(year + "年" + "" + month + "月"); //指定した年月の一日の曜日を取得 LocalDate firstDay = LocalDate.of(year, month, 1); DayOfWeek dayOfWeek = firstDay.getDayOfWeek(); @@ -205,7 +206,7 @@ List schedules = new ArrayList<>(); schedules.add(new Schedule("abc", "3232", "yyyy", 0, 1)); schedules.add(new Schedule("123", "3232", "yyyy", 0, 2)); - if(i==2&&j==1)schedules.add(new Schedule("aho", "3232", "yyyy", 0, 5)); + if(i==2&&j==1)schedules.add(new Schedule("cat", "3232", "yyyy", 0, 5)); recyclerView.setAdapter(new MyScheduleAdapter(schedules)); LinearLayout.LayoutParams p = (LinearLayout.LayoutParams) recyclerView.getLayoutParams(); p.weight = 1; @@ -232,8 +233,9 @@ month--; if(month < 1) { month = 12; + year--; } - curMonth.setText("" + month + "月"); + curMonth.setText(year + "年" + "" + month + "月"); //指定した年月の一日の曜日を取得 LocalDate firstDay = LocalDate.of(year, month, 1); DayOfWeek dayOfWeek = firstDay.getDayOfWeek(); @@ -263,7 +265,7 @@ List schedules = new ArrayList<>(); schedules.add(new Schedule("abc", "3232", "yyyy", 0, 1)); schedules.add(new Schedule("123", "3232", "yyyy", 0, 2)); - if(i==2&&j==1)schedules.add(new Schedule("aho", "3232", "yyyy", 0, 5)); + if(i==2&&j==1)schedules.add(new Schedule("cat", "3232", "yyyy", 0, 5)); recyclerView.setAdapter(new MyScheduleAdapter(schedules)); LinearLayout.LayoutParams p = (LinearLayout.LayoutParams) recyclerView.getLayoutParams(); p.weight = 1;