Menu

Exclude Week Rule

Anonymous
2015-03-17
2015-03-18
  • Anonymous

    Anonymous - 2015-03-17

    Would like to setup a daily meeting from the March 1st to June 30st; however, excluding weekends. I looked through the API; particular the ExceptionDate class and I unable to determine how I would do this. Please adive.

    Thanks

     
  • Michael Angstadt

    Hello,

    I don't believe you need to use the ExceptionDate property. You can specify which days of the week you want the event to occur on by using the BYDAY component:

    :::java
    DateFormat df = new SimpleDateFormat("yyyy-MM-dd");
    Recurrence recur = new Recurrence.Builder(Frequency.DAILY)
      .until(df.parse("2015-06-30"), false)
      .byDay(DayOfWeek.MONDAY, DayOfWeek.TUESDAY, DayOfWeek.WEDNESDAY, DayOfWeek.THURSDAY, DayOfWeek.FRIDAY)
      .build();
    RecurrenceRule rrule = new RecurrenceRule(recur);
    
     

    Last edit: Michael Angstadt 2015-03-17
  • Anonymous

    Anonymous - 2015-03-18

    Worked perfectly...Thank you so much.

     

Anonymous
Anonymous

Add attachments
Cancel





Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.