Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8544883
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T12:40:03+00:00 2026-06-11T12:40:03+00:00

I have a calendar app. I want to loop through the current month to

  • 0

I have a calendar app. I want to loop through the current month to get all the events. The only problem is that the date displays of the last event for all the events.

It seems the date value of all the events is replaced by the date value of the last event.

   CalendarEvents events = new CalendarEvents();
   final ArrayList<Event> e = new ArrayList<Event>();


    for(int i = 0; i < _calendar.getActualMaximum(Calendar.DAY_OF_MONTH); i++){
        if(isHoliday(i, month, year, date_value))
        {
            String date = i + "-" + month + "-" + year;

            e.addAll(events.eventDetails(month, day));
            summary_data = new Summary[e.size()];

            for (int j = 0; j < e.size(); j++)
            {

               Event event = e.get(j);
               summary_data[j] = new Summary(date, event.eventdetails);
            } 
        }
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T12:40:05+00:00Added an answer on June 11, 2026 at 12:40 pm

    Yes, that’s expected given the logic of the program.

    You loop through the days. For each day, you add the events of the day to a list of events (the badly named e list). And for each day, you the loop through each events in this list (which thus contains all the events from the start of the month until the current day), and create an array of Summary instances, each summary containing the date of the current day, and the details of the event (whether it’s a past event or an event of the current day).

    The list of events doesn’t seem useful. I would simply use a list of summaries:

    final List<Summary> summaries = new ArrayList<Summary>();
    
    // loop through the days
    for (int i = 0; i < calendar.getActualMaximum(Calendar.DAY_OF_MONTH); i++) {
        if (isHoliday(i, month, year, date_value)) {
            String date = i + "-" + month + "-" + year;
            // loop through the events of the day
            for (Event event : events.eventDetails(month, day)) {
                // add a summary for the current day and the current event of the day
                summaries.add(new Summary(date, event.eventdetails));
            } 
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Well in my app I want to get current date and month abnd local
I have an app that queries the google calendar instances and events API in
I have a calendar app. I want to add a listview which displays all
I have an app with a calendar page. On that page I have elements
Right so I have a simple app that consists of a calendar a Set
I have calendar in Qt. I want when user selects date, 14(Qint32) will be
I want to have a calendar in my application, so that every user can
I have a web-app that is a sort of calendar application and there are
I have a table which lists all events on a debating calendar. Each row
I have attached my code below. i want to get dialogue of Date picker

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.