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 7743757
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T09:37:00+00:00 2026-06-01T09:37:00+00:00

Just started playing around with ice_cube I’ve got a weekly schedule (with a granularity

  • 0

Just started playing around with ice_cube I’ve got a weekly schedule (with a granularity of half an hour) created

schedule = IceCube::Schedule.new(Time.now.change(:min => 30))

with several rules (let’s say 20) such as e.g.

IceCube::Rule.weekly.day(:tuesday).hour_of_day(14).minute_of_hour(30)

or

IceCube::Rule.weekly.day(:wednesday).hour_of_day(10).minute_of_hour(0)

Now I’d like to exclude a full day, which would subsequently exclude all occurrences during this full day.

I’ve tried

schedule.add_exception_date [DATE]

but it seems that my exception has to match the event exactly.

Is there a way to get this done without looping through all rules and creating exception for the exact times for the date specified?


Update:

To make a better example:

Weekly schedule:
  * Every monday at 14:40
  * Every monday at 15:00
  * Every thursday at 16:00 
  * Every saturday at 10:00

Exception date:
  Tuesday, 13th of September 2011

=> For the week from Monday 12th to Sunday 18th I'd like to get only the occurrences on Thursday and Saturday.

One solution could look something like this, but it’s a little icky:

schedule    = IceCube::Schedule.from_yaml([PERSISTED SCHEDULE])
occurrences = schedule.occurrences_between([START TIME], [END TIME])
exceptions  = schedule.exdates.map(&:to_date)
occurrences.reject {|occurrence|
  exceptions.include?(occurrence.to_date)
}

—Any better ideas?

  • 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-01T09:37:01+00:00Added an answer on June 1, 2026 at 9:37 am

    Since there seems to be no other solution and in order to close this question, here’s what I’m using (as described in an update to the original question above already):

    schedule    = IceCube::Schedule.from_yaml([PERSISTED SCHEDULE])
    occurrences = schedule.occurrences_between([START TIME], [END TIME])
    exceptions  = schedule.exdates.map(&:to_date)
    occurrences.reject {|occurrence|
      exceptions.include?(occurrence.to_date)
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've just started playing around in Haskell. After years of Ruby, I got used
I'm new to cmake and have just started playing around with it. My problem
I just started playing around with JSON and I have created this example. var
I recently just started playing around in PHP and got myself a small project/homework.
I just started playing around with threading today and I ran into something that
I just started playing around with the 960 CSS framework and found that it
I'm just started on playing around with the canvas HTML5-object. For the sake of
I'm just getting started with ASP.NET MVC 2, and playing around with Validation. Let's
I just started playing around with Unicorn and NGINX set up (any full-blown reference
I just started playing around with WPF today, and I couldn't find the datagridview

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.