From 3f3bbe169b5da9e72124f4e5985518acb1dd4f7f Mon Sep 17 00:00:00 2001 From: bellotti Date: Tue, 14 Jun 2016 18:03:00 +0200 Subject: [PATCH 1/5] updated gradle to 2.1.2 version --- build.gradle | 2 +- gradle/wrapper/gradle-wrapper.properties | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index b1e051f..2deced5 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:1.1.0' + classpath 'com.android.tools.build:gradle:2.1.2' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index fa3a6af..c64c1a7 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Wed Dec 10 14:37:29 CET 2014 +#Tue Jun 14 18:01:01 CEST 2016 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip From 81ccc1b589d0987abb33411596727c1b6f4bc3e0 Mon Sep 17 00:00:00 2001 From: bellotti Date: Tue, 14 Jun 2016 18:52:17 +0200 Subject: [PATCH 2/5] added "MinYear" and "CurrentYear" --- .../library/DatePickerController.java | 10 +- .../library/DayPickerView.java | 103 +++++---- .../library/SimpleMonthAdapter.java | 212 +++++++++--------- .../com/andexert/sample/MainActivity.java | 12 +- 4 files changed, 181 insertions(+), 156 deletions(-) diff --git a/library/src/main/java/com/andexert/calendarlistview/library/DatePickerController.java b/library/src/main/java/com/andexert/calendarlistview/library/DatePickerController.java index 3b9da03..ec37dde 100644 --- a/library/src/main/java/com/andexert/calendarlistview/library/DatePickerController.java +++ b/library/src/main/java/com/andexert/calendarlistview/library/DatePickerController.java @@ -24,10 +24,14 @@ package com.andexert.calendarlistview.library; public interface DatePickerController { - public abstract int getMaxYear(); + int getMaxYear(); - public abstract void onDayOfMonthSelected(int year, int month, int day); + int getMinYear(); - public abstract void onDateRangeSelected(final SimpleMonthAdapter.SelectedDays selectedDays); + int getCurrentYear(); + + void onDayOfMonthSelected(int year, int month, int day); + + void onDateRangeSelected(final SimpleMonthAdapter.SelectedDays selectedDays); } \ No newline at end of file diff --git a/library/src/main/java/com/andexert/calendarlistview/library/DayPickerView.java b/library/src/main/java/com/andexert/calendarlistview/library/DayPickerView.java index 1584aee..bcfe653 100644 --- a/library/src/main/java/com/andexert/calendarlistview/library/DayPickerView.java +++ b/library/src/main/java/com/andexert/calendarlistview/library/DayPickerView.java @@ -1,18 +1,18 @@ /*********************************************************************************** * The MIT License (MIT) - + *

* Copyright (c) 2014 Robin Chutaux - + *

* Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: - + *

* The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. - + *

* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -29,56 +29,58 @@ import android.support.v7.widget.RecyclerView; import android.util.AttributeSet; -public class DayPickerView extends RecyclerView -{ +public class DayPickerView extends RecyclerView { protected Context mContext; - protected SimpleMonthAdapter mAdapter; - private DatePickerController mController; + protected SimpleMonthAdapter mAdapter; + private DatePickerController mController; protected int mCurrentScrollState = 0; - protected long mPreviousScrollPosition; - protected int mPreviousScrollState = 0; + protected long mPreviousScrollPosition; + protected int mPreviousScrollState = 0; private TypedArray typedArray; private OnScrollListener onScrollListener; - public DayPickerView(Context context) - { + public DayPickerView(Context context) { this(context, null); } - public DayPickerView(Context context, AttributeSet attrs) - { + public DayPickerView(Context context, AttributeSet attrs) { this(context, attrs, 0); } - public DayPickerView(Context context, AttributeSet attrs, int defStyle) - { + public DayPickerView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); - if (!isInEditMode()) - { + if (!isInEditMode()) { typedArray = context.obtainStyledAttributes(attrs, R.styleable.DayPickerView); setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT)); init(context); } } - public void setController(DatePickerController mController) - { + public void setController(DatePickerController mController) { this.mController = mController; setUpAdapter(); + scrollToCurrentYear(); setAdapter(mAdapter); } + protected void scrollToCurrentYear() { + mController.getMaxYear(); + mController.getMinYear(); - public void init(Context paramContext) { + int currentYear = mController.getCurrentYear(); + if (currentYear != -1) { + scrollToMonth(currentYear, mAdapter.getFirstMonth()); + } + } + + protected void init(Context paramContext) { setLayoutManager(new LinearLayoutManager(paramContext)); - mContext = paramContext; - setUpListView(); + mContext = paramContext; + setUpListView(); - onScrollListener = new OnScrollListener() - { + onScrollListener = new OnScrollListener() { @Override - public void onScrolled(RecyclerView recyclerView, int dx, int dy) - { + public void onScrolled(RecyclerView recyclerView, int dx, int dy) { super.onScrolled(recyclerView, dx, dy); final SimpleMonthView child = (SimpleMonthView) recyclerView.getChildAt(0); if (child == null) { @@ -89,34 +91,47 @@ public void onScrolled(RecyclerView recyclerView, int dx, int dy) mPreviousScrollState = mCurrentScrollState; } }; - } + } + + + protected void setUpAdapter() { + if (mAdapter == null) { + mAdapter = new SimpleMonthAdapter(getContext(), mController, typedArray); + } + + mAdapter.notifyDataSetChanged(); + } + - protected void setUpAdapter() { - if (mAdapter == null) { - mAdapter = new SimpleMonthAdapter(getContext(), mController, typedArray); + protected void setUpListView() { + setVerticalScrollBarEnabled(false); + setOnScrollListener(onScrollListener); + setFadingEdgeLength(0); + } + + public void scrollToMonth(int year, int month) { + if (mController != null && mAdapter != null) { + int position = ((year - mController.getMinYear()) * SimpleMonthAdapter.MONTHS_IN_YEAR) + + (mAdapter.getFirstMonth() - month); + if (position > 0) { + scrollToPosition(position); + } + } else { + throw new UnsupportedOperationException("Do you specified a DatePickerController?"); } - mAdapter.notifyDataSetChanged(); - } + } - protected void setUpListView() { - setVerticalScrollBarEnabled(false); - setOnScrollListener(onScrollListener); - setFadingEdgeLength(0); - } - public SimpleMonthAdapter.SelectedDays getSelectedDays() - { + public SimpleMonthAdapter.SelectedDays getSelectedDays() { return mAdapter.getSelectedDays(); } - protected DatePickerController getController() - { + protected DatePickerController getController() { return mController; } - protected TypedArray getTypedArray() - { + protected TypedArray getTypedArray() { return typedArray; } } \ No newline at end of file diff --git a/library/src/main/java/com/andexert/calendarlistview/library/SimpleMonthAdapter.java b/library/src/main/java/com/andexert/calendarlistview/library/SimpleMonthAdapter.java index 20e1b0e..3af700b 100644 --- a/library/src/main/java/com/andexert/calendarlistview/library/SimpleMonthAdapter.java +++ b/library/src/main/java/com/andexert/calendarlistview/library/SimpleMonthAdapter.java @@ -1,18 +1,18 @@ /*********************************************************************************** * The MIT License (MIT) - + *

* Copyright (c) 2014 Robin Chutaux - + *

* Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: - + *

* The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. - + *

* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -39,41 +39,42 @@ public class SimpleMonthAdapter extends RecyclerView.Adapter implements SimpleMonthView.OnDayClickListener { protected static final int MONTHS_IN_YEAR = 12; private final TypedArray typedArray; - private final Context mContext; - private final DatePickerController mController; + private final Context mContext; + private final DatePickerController mController; private final Calendar calendar; private final SelectedDays selectedDays; private final Integer firstMonth; private final Integer lastMonth; + private int mMaxYear; + private int mMinYear; + - public SimpleMonthAdapter(Context context, DatePickerController datePickerController, TypedArray typedArray) { + public SimpleMonthAdapter(Context context, DatePickerController datePickerController, TypedArray typedArray) { this.typedArray = typedArray; calendar = Calendar.getInstance(); firstMonth = typedArray.getInt(R.styleable.DayPickerView_firstMonth, calendar.get(Calendar.MONTH)); lastMonth = typedArray.getInt(R.styleable.DayPickerView_lastMonth, (calendar.get(Calendar.MONTH) - 1) % MONTHS_IN_YEAR); selectedDays = new SelectedDays<>(); - mContext = context; - mController = datePickerController; - init(); - } + mContext = context; + mController = datePickerController; + init(); + } @Override - public ViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) - { + public ViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) { final SimpleMonthView simpleMonthView = new SimpleMonthView(mContext, typedArray); return new ViewHolder(simpleMonthView, this); } @Override - public void onBindViewHolder(ViewHolder viewHolder, int position) - { + public void onBindViewHolder(ViewHolder viewHolder, int position) { final SimpleMonthView v = viewHolder.simpleMonthView; final HashMap drawingParams = new HashMap(); int month; int year; month = (firstMonth + (position % MONTHS_IN_YEAR)) % MONTHS_IN_YEAR; - year = position / MONTHS_IN_YEAR + calendar.get(Calendar.YEAR) + ((firstMonth + (position % MONTHS_IN_YEAR)) / MONTHS_IN_YEAR); + year = position / MONTHS_IN_YEAR + mMinYear + ((firstMonth + (position % MONTHS_IN_YEAR)) / MONTHS_IN_YEAR); int selectedFirstDay = -1; int selectedLastDay = -1; @@ -82,15 +83,13 @@ public void onBindViewHolder(ViewHolder viewHolder, int position) int selectedFirstYear = -1; int selectedLastYear = -1; - if (selectedDays.getFirst() != null) - { + if (selectedDays.getFirst() != null) { selectedFirstDay = selectedDays.getFirst().day; selectedFirstMonth = selectedDays.getFirst().month; selectedFirstYear = selectedDays.getFirst().year; } - if (selectedDays.getLast() != null) - { + if (selectedDays.getLast() != null) { selectedLastDay = selectedDays.getLast().day; selectedLastMonth = selectedDays.getLast().month; selectedLastYear = selectedDays.getLast().year; @@ -112,13 +111,12 @@ public void onBindViewHolder(ViewHolder viewHolder, int position) } public long getItemId(int position) { - return position; - } + return position; + } @Override - public int getItemCount() - { - int itemCount = (((mController.getMaxYear() - calendar.get(Calendar.YEAR)) + 1) * MONTHS_IN_YEAR); + public int getItemCount() { + int itemCount = (((mMaxYear - mMinYear) + 1) * MONTHS_IN_YEAR); if (firstMonth != -1) itemCount -= firstMonth; @@ -129,12 +127,10 @@ public int getItemCount() return itemCount; } - public static class ViewHolder extends RecyclerView.ViewHolder - { + public static class ViewHolder extends RecyclerView.ViewHolder { final SimpleMonthView simpleMonthView; - public ViewHolder(View itemView, SimpleMonthView.OnDayClickListener onDayClickListener) - { + public ViewHolder(View itemView, SimpleMonthView.OnDayClickListener onDayClickListener) { super(itemView); simpleMonthView = (SimpleMonthView) itemView; simpleMonthView.setLayoutParams(new AbsListView.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT)); @@ -143,97 +139,104 @@ public ViewHolder(View itemView, SimpleMonthView.OnDayClickListener onDayClickLi } } - protected void init() { - if (typedArray.getBoolean(R.styleable.DayPickerView_currentDaySelected, false)) + protected void init() { + if (typedArray.getBoolean(R.styleable.DayPickerView_currentDaySelected, false)) { onDayTapped(new CalendarDay(System.currentTimeMillis())); - } + } + + mMinYear = mController.getMinYear(); + mMaxYear = mController.getMaxYear(); - public void onDayClick(SimpleMonthView simpleMonthView, CalendarDay calendarDay) { - if (calendarDay != null) { - onDayTapped(calendarDay); + if (mMaxYear < mMinYear) { + int temp = mMaxYear; + mMaxYear = mMinYear; + mMinYear = temp; } - } + } + + public void onDayClick(SimpleMonthView simpleMonthView, CalendarDay calendarDay) { + if (calendarDay != null) { + onDayTapped(calendarDay); + } + } - protected void onDayTapped(CalendarDay calendarDay) { - mController.onDayOfMonthSelected(calendarDay.year, calendarDay.month, calendarDay.day); - setSelectedDay(calendarDay); - } + protected void onDayTapped(CalendarDay calendarDay) { + mController.onDayOfMonthSelected(calendarDay.year, calendarDay.month, calendarDay.day); + setSelectedDay(calendarDay); + } - public void setSelectedDay(CalendarDay calendarDay) { - if (selectedDays.getFirst() != null && selectedDays.getLast() == null) - { + public void setSelectedDay(CalendarDay calendarDay) { + if (selectedDays.getFirst() != null && selectedDays.getLast() == null) { selectedDays.setLast(calendarDay); - if (selectedDays.getFirst().month < calendarDay.month) - { + if (selectedDays.getFirst().month < calendarDay.month) { for (int i = 0; i < selectedDays.getFirst().month - calendarDay.month - 1; ++i) mController.onDayOfMonthSelected(selectedDays.getFirst().year, selectedDays.getFirst().month + i, selectedDays.getFirst().day); } mController.onDateRangeSelected(selectedDays); - } - else if (selectedDays.getLast() != null) - { + } else if (selectedDays.getLast() != null) { selectedDays.setFirst(calendarDay); selectedDays.setLast(null); - } - else + } else selectedDays.setFirst(calendarDay); - notifyDataSetChanged(); - } + notifyDataSetChanged(); + } - public static class CalendarDay implements Serializable - { + public int getFirstMonth() { + return firstMonth; + } + + public static class CalendarDay implements Serializable { private static final long serialVersionUID = -5456695978688356202L; private Calendar calendar; - int day; - int month; - int year; + int day; + int month; + int year; - public CalendarDay() { - setTime(System.currentTimeMillis()); - } + public CalendarDay() { + setTime(System.currentTimeMillis()); + } - public CalendarDay(int year, int month, int day) { - setDay(year, month, day); - } + public CalendarDay(int year, int month, int day) { + setDay(year, month, day); + } - public CalendarDay(long timeInMillis) { - setTime(timeInMillis); - } + public CalendarDay(long timeInMillis) { + setTime(timeInMillis); + } - public CalendarDay(Calendar calendar) { - year = calendar.get(Calendar.YEAR); - month = calendar.get(Calendar.MONTH); - day = calendar.get(Calendar.DAY_OF_MONTH); - } + public CalendarDay(Calendar calendar) { + year = calendar.get(Calendar.YEAR); + month = calendar.get(Calendar.MONTH); + day = calendar.get(Calendar.DAY_OF_MONTH); + } - private void setTime(long timeInMillis) { - if (calendar == null) { - calendar = Calendar.getInstance(); + private void setTime(long timeInMillis) { + if (calendar == null) { + calendar = Calendar.getInstance(); } - calendar.setTimeInMillis(timeInMillis); - month = this.calendar.get(Calendar.MONTH); - year = this.calendar.get(Calendar.YEAR); - day = this.calendar.get(Calendar.DAY_OF_MONTH); - } - - public void set(CalendarDay calendarDay) { - year = calendarDay.year; - month = calendarDay.month; - day = calendarDay.day; - } - - public void setDay(int year, int month, int day) { - this.year = year; - this.month = month; - this.day = day; - } - - public Date getDate() - { + calendar.setTimeInMillis(timeInMillis); + month = this.calendar.get(Calendar.MONTH); + year = this.calendar.get(Calendar.YEAR); + day = this.calendar.get(Calendar.DAY_OF_MONTH); + } + + public void set(CalendarDay calendarDay) { + year = calendarDay.year; + month = calendarDay.month; + day = calendarDay.day; + } + + public void setDay(int year, int month, int day) { + this.year = year; + this.month = month; + this.day = day; + } + + public Date getDate() { if (calendar == null) { calendar = Calendar.getInstance(); } @@ -242,8 +245,7 @@ public Date getDate() } @Override - public String toString() - { + public String toString() { final StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append("{ year: "); stringBuilder.append(year); @@ -257,34 +259,28 @@ public String toString() } } - public SelectedDays getSelectedDays() - { + public SelectedDays getSelectedDays() { return selectedDays; } - public static class SelectedDays implements Serializable - { + public static class SelectedDays implements Serializable { private static final long serialVersionUID = 3942549765282708376L; private K first; private K last; - public K getFirst() - { + public K getFirst() { return first; } - public void setFirst(K first) - { + public void setFirst(K first) { this.first = first; } - public K getLast() - { + public K getLast() { return last; } - public void setLast(K last) - { + public void setLast(K last) { this.last = last; } } diff --git a/sample/src/main/java/com/andexert/sample/MainActivity.java b/sample/src/main/java/com/andexert/sample/MainActivity.java index ca37b63..65e61a3 100644 --- a/sample/src/main/java/com/andexert/sample/MainActivity.java +++ b/sample/src/main/java/com/andexert/sample/MainActivity.java @@ -46,7 +46,17 @@ public boolean onOptionsItemSelected(MenuItem item) { @Override public int getMaxYear() { - return 2015; + return 2020; + } + + @Override + public int getMinYear() { + return 1900; + } + + @Override + public int getCurrentYear() { + return 2016; } @Override From eb53f37e26abb1385605e5bc9e8801b5459db43b Mon Sep 17 00:00:00 2001 From: bellotti Date: Wed, 15 Jun 2016 10:22:27 +0200 Subject: [PATCH 3/5] cleaned code --- .../calendarlistview/library/DayPickerView.java | 17 +++++------------ .../java/com/andexert/sample/MainActivity.java | 2 +- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/library/src/main/java/com/andexert/calendarlistview/library/DayPickerView.java b/library/src/main/java/com/andexert/calendarlistview/library/DayPickerView.java index bcfe653..55853b2 100644 --- a/library/src/main/java/com/andexert/calendarlistview/library/DayPickerView.java +++ b/library/src/main/java/com/andexert/calendarlistview/library/DayPickerView.java @@ -1,18 +1,18 @@ /*********************************************************************************** * The MIT License (MIT) - *

+ *

* Copyright (c) 2014 Robin Chutaux - *

+ *

* Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: - *

+ *

* The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. - *

+ *

* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -64,13 +64,7 @@ public void setController(DatePickerController mController) { } protected void scrollToCurrentYear() { - mController.getMaxYear(); - mController.getMinYear(); - - int currentYear = mController.getCurrentYear(); - if (currentYear != -1) { - scrollToMonth(currentYear, mAdapter.getFirstMonth()); - } + scrollToMonth(mController.getCurrentYear(), mAdapter.getFirstMonth()); } protected void init(Context paramContext) { @@ -103,7 +97,6 @@ protected void setUpAdapter() { } - protected void setUpListView() { setVerticalScrollBarEnabled(false); setOnScrollListener(onScrollListener); diff --git a/sample/src/main/java/com/andexert/sample/MainActivity.java b/sample/src/main/java/com/andexert/sample/MainActivity.java index 65e61a3..9279e8d 100644 --- a/sample/src/main/java/com/andexert/sample/MainActivity.java +++ b/sample/src/main/java/com/andexert/sample/MainActivity.java @@ -51,7 +51,7 @@ public int getMaxYear() @Override public int getMinYear() { - return 1900; + return 1970; } @Override From febafb24523b1a70e602165cf6d2f38a43ff0d57 Mon Sep 17 00:00:00 2001 From: bellotti Date: Wed, 15 Jun 2016 10:22:56 +0200 Subject: [PATCH 4/5] updated README --- README.md | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e032137..3fa4e38 100644 --- a/README.md +++ b/README.md @@ -31,14 +31,32 @@ Declare a DayPickerView inside your layout XML file: ``` -Next, you have to implement `DatePickerController` in your Activity or your Fragment. You will have to set `getMaxYear` and `onDayOfMonthSelected`. The first one is the max year between the current one and this maxYear. The second one is called every time user selects a new date. +Next, you have to implement `DatePickerController` in your Activity or your Fragment. +You will have to set: + +- `getMinYear`: start year +- `getMaxYear`: last year +- `getCurrentYear`: is the current year actually displayed +- `onDayOfMonthSelected`: is called every time user selects a new date ``` java + @Override + public int getMinYear() + { + return 1970; + } + @Override public int getMaxYear() { - return 2015; + return 2016; + } + + @Override + public int getCurrentYear() + { + return 2016; } @Override From 1c29fc583dc78f264edfa2b7e1248a7dcfc1bd25 Mon Sep 17 00:00:00 2001 From: bellotti Date: Wed, 15 Jun 2016 10:26:04 +0200 Subject: [PATCH 5/5] updated README --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3fa4e38..e150433 100644 --- a/README.md +++ b/README.md @@ -34,8 +34,8 @@ Declare a DayPickerView inside your layout XML file: Next, you have to implement `DatePickerController` in your Activity or your Fragment. You will have to set: -- `getMinYear`: start year -- `getMaxYear`: last year +- `getMinYear`: starting year +- `getMaxYear`: final year - `getCurrentYear`: is the current year actually displayed - `onDayOfMonthSelected`: is called every time user selects a new date