Skip to content

Bug: onLongClickΒ #58

@ankur2136

Description

@ankur2136

Long Press on March 29, 2018 selects March 1 , 2018 due to the following code.

    Calendar calendar = Calendar.getInstance();
    calendar.setFirstDayOfWeek(firstDayOfWeek);
    calendar.setTime(calendar.getTime());
    calendar.set(Calendar.DAY_OF_MONTH, Integer.valueOf(dayOfMonthText.getText().toString()));

    markDateAsSelected(calendar.getTime());

You are setting the time from the same instance you are getting the time which is pretty useless.
I think you meant to use calendar.setTime(this.calendar.getTime());

Better yet, refactor the code to use member variable naming so this wouldn't happen.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions