Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to focus and show current date while showing this calender #4

Open
ashu9g opened this issue Mar 20, 2021 · 1 comment
Open

How to focus and show current date while showing this calender #4

ashu9g opened this issue Mar 20, 2021 · 1 comment

Comments

@ashu9g
Copy link

ashu9g commented Mar 20, 2021

I want to show and focus on current day when this calender is shown, how to do it?

From below code, it is focus/showing 1 Jan 2021, i want to show current day when the calender is shown, how?

DatePickerTimeline datePickerTimeline = dialog.findViewById(R.id.datePickerTimeline);
       // Set a Start date (Default, 1 Jan 1970)
       Calendar today = Calendar.getInstance();

       datePickerTimeline.setInitialDate(2021, 0, 1);
       datePickerTimeline.setActiveDate(today);
       datePickerTimeline.setActivated(true); 
@nilavan66
Copy link

try this
Code:

Code

HorizontalCalendarView calendarView = view.findViewById(R.id.hori_calander);

   Calendar startdate = Calendar.getInstance();
   startdate.add(Calendar.YEAR, -5);

   Calendar enddate = Calendar.getInstance();
   enddate.add(Calendar.YEAR, 10);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants