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

goToday() and selectDate() selecting incorrect date #63

Closed
alliejc opened this issue Jan 16, 2018 · 8 comments
Closed

goToday() and selectDate() selecting incorrect date #63

alliejc opened this issue Jan 16, 2018 · 8 comments

Comments

@alliejc
Copy link

alliejc commented Jan 16, 2018

Expected Behavior / Goal

I have placed a button in my toolbar that should return the horizontal calendar to today.

Actual Behavior

Upon clicking the today button, the horizontal calendar will intermittently return to the wrong day.

Steps to Reproduce the Problem

I have tried this 2 different ways:

Using selectDate()

  if(id == R.id.today_button) {
            Calendar today = Calendar.getInstance();
            if(mHorizontalCalendar != null){
                mHorizontalCalendar.selectDate(today, true);
            }
        }

Using goToday()

 if(id == R.id.today_button) {
            if(mHorizontalCalendar != null){
                mHorizontalCalendar.goToday(true);
            }
        }

When using selectDate(), the outcome is intermittently 1 day before (ie. today is Tuesday, it will switch between selecting Monday and Tuesday as today)

When using goToday(), the outcome is intermittently 1 day before, or 1 day after (ie. today is Tuesday, it will switch between selecting Monday, Tuesday, and Wednesday as today)

Specifications

  • Android Version: 6.0.1 and 8.1.0
  • Horizontal-Calendar Version: 1.3.2
@muraee muraee closed this as completed in dab7b64 Jan 18, 2018
@alliejc
Copy link
Author

alliejc commented Feb 1, 2018

@Mulham-Raee what does the timeline look like for releasing these changes? Thanks!

@muraee
Copy link
Owner

muraee commented Feb 2, 2018

@alliejc changes are live in version 1.3.4

@srseibs
Copy link

srseibs commented Apr 29, 2018

I am having the same problem in 1.3.4 so I am not sure this is fixed.

@shivamyadavappinventiv
Copy link

Still getting this problem for london time zone while working for kolkata time zone.

@alliejc
Copy link
Author

alliejc commented May 27, 2018

@srseibs I am also still seeing the same problem

@KORuL
Copy link

KORuL commented May 30, 2019

@srseibs @Mulham-Raee I am also still seeing the same problem

@muraee
Copy link
Owner

muraee commented May 31, 2019

Issue fix was committed a while ago to this repository, but it is not available on jCenter yet. You can clone this repository and use it locally for now.

@KORuL
Copy link

KORuL commented Jun 1, 2019

I clone this repo!

        calendarHorizontal = HorizontalCalendar.Builder(this, R.id.calendarViewHorizontal)
            .range(startDate, endDate)
            .datesNumberOnScreen(8)   // Number of Dates cells shown on screen (Recommended 5)
            .configure()
            .formatTopText("EEE")       // default to "MMM".
            .formatMiddleText("dd")    // default to "dd".
            .formatBottomText("MMM''yy")    // default to "EEE".
            .sizeBottomText(10f)
            .sizeTopText(14f)
            .sizeMiddleText(21f)
            .textColor(
                ContextCompat.getColor(applicationContext, R.color.new_black_unsel),
                ContextCompat.getColor(applicationContext, R.color.new_black_sel)
            )    // Text color for none selected Dates, Text color for selected Date.
            .selectedDateBackground(getResourses().getDrawable(R.drawable.gradient_selected_calendar))  // Background Drawable of the selected date cell.
            .selectorColor(
                ContextCompat.getColor(
                    applicationContext,
                    R.color.new_calendar_selector_color
                )
            )
            .end()
            .defaultSelectedDate(Calendar.getInstance())
            .build()

if datesNumberOnScreen(8) - selecting incorrect date
image

My Issue #117

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

5 participants