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

February 2016 has 29 days but I get 28 #28

Open
RiccardoFabozzi opened this issue Sep 18, 2015 · 0 comments
Open

February 2016 has 29 days but I get 28 #28

RiccardoFabozzi opened this issue Sep 18, 2015 · 0 comments

Comments

@RiccardoFabozzi
Copy link

The issue is in the title (http://www.timeanddate.com/calendar/custom.html?year=2016&country=1&hol=25&df=1). I'm getting the same error for February 2020 and 2024.
Below my code:

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.MenuItem;
import android.widget.TextView;

import com.andexert.calendarlistview.library.DayPickerView;
import com.andexert.calendarlistview.library.SimpleMonthAdapter;

public class Calendar extends AppCompatActivity implements com.andexert.calendarlistview.library.DatePickerController{

    @Override
    protected void onCreate(Bundle savedInstanceState){
        super.onCreate(savedInstanceState);
        setContentView(R.layout.calendar);

        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar_layout);

        TextView mTitle = (TextView) toolbar.findViewById(R.id.toolbar_title);
        mTitle.setText("Calendar");
        setSupportActionBar(toolbar);

        assert getSupportActionBar() != null;

        this.getSupportActionBar().setDisplayHomeAsUpEnabled(true); 
        this.getSupportActionBar().setDisplayShowTitleEnabled(false);

        DayPickerView dayPickerView = (DayPickerView)findViewById(R.id.pickerView);
        dayPickerView.setController(this);

    }

    @Override
    public int getMaxYear()
    {
        return 2026;
    }

    @Override
    public void onDayOfMonthSelected(int year, int month, int day)
    {
        Log.e("Day Selected", day + " / " + month + " / " + year);
    }

    @Override
    public void onDateRangeSelected(SimpleMonthAdapter.SelectedDays<SimpleMonthAdapter.CalendarDay> selectedDays)
    {

        Log.e("Date range selected", selectedDays.getFirst().toString() + " --> " + selectedDays.getLast().toString());
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()) {
            case android.R.id.home:
                finish();
                return true;
            default:
                return super.onOptionsItemSelected(item);
        }
    }

}
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

1 participant