How to use the rrule.RRule.DAILY function in rrule

To help you get started, we’ve selected a few rrule examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github bcgov / queue-management / frontend / src / booking / booking-blackout-modal.vue View on Github external
let duration_minutes = duration.asMinutes()
          let booking_input_frequency = null
          let local_booking_dates_array = []

          switch(this.selected_booking_frequency[0]){
            case 0:
              booking_input_frequency = RRule.YEARLY;
              break;
            case 1:
              booking_input_frequency = RRule.MONTHLY;
              break;
            case 2:
              booking_input_frequency = RRule.WEEKLY;
              break;
            case 3:
              booking_input_frequency = RRule.DAILY;
              break;
          }

          if(isNaN(start_year) == false || isNaN(end_year) == false){

            // TODO Might be Deprecated -- IF RRule Breaks, this is where it will happen
            // Removed hours and minutes from date_start and until
            let date_start = new Date(Date.UTC(start_year, start_month -1, start_day))
            let until = new Date(Date.UTC(end_year, end_month -1, end_day))

            const rule = new RRule({
              freq: booking_input_frequency,
              count: this.selected_booking_count,
              byweekday: this.selected_booking_weekdays,
              dtstart: date_start,
              until: until,
github bcgov / queue-management / frontend / src / booking / other-booking-modal.vue View on Github external
let duration_minutes = duration.asMinutes()
        let input_frequency = null
        let local_other_dates_array = []

        switch(this.other_selected_frequency[0]){
          case 0:
            input_frequency = RRule.YEARLY;
            break;
          case 1:
            input_frequency = RRule.MONTHLY;
            break;
          case 2:
            input_frequency = RRule.WEEKLY;
            break;
          case 3:
            input_frequency = RRule.DAILY;
            break;
        }

        if(isNaN(start_year) == false || isNaN(end_year) == false){
          // TODO Might be Deprecated -- IF RRule Breaks, this is where it will happen
          let date_start = new Date(Date.UTC(start_year, start_month-1, start_day))
          let until = new Date(Date.UTC(end_year, end_month-1, end_day))

          const rule = new RRule({
            freq: input_frequency,
            count: this.other_selected_count,
            byweekday: this.other_selected_weekdays,
            dtstart: date_start,
            until: until
          })
github bcgov / queue-management / frontend / src / appointments / appt-booking-modal / appt-blackout-modal.vue View on Github external
let duration_minutes = duration.asMinutes()
            let input_frequency = null
            let local_dates_array = []

            switch(this.selected_frequency[0]){
              case 0:
                input_frequency = RRule.YEARLY;
                break;
              case 1:
                input_frequency = RRule.MONTHLY;
                break;
              case 2:
                input_frequency = RRule.WEEKLY;
                break;
              case 3:
                input_frequency = RRule.DAILY;
                break;
            }

            if(isNaN(start_year) == false || isNaN(end_year) == false) {
              // TODO Might be Deprecated -- IF RRule Breaks, this is where it will happen
              // TODO remove tzid from rule object
              let date_start = new Date(Date.UTC(start_year, start_month - 1, start_day, start_hour, start_minute))
              let until = new Date(Date.UTC(end_year, end_month - 1, end_day, end_hour, end_minute))
              const rule = new RRule({
                freq: input_frequency,
                count: this.selected_count,
                byweekday: this.selected_weekdays,
                dtstart: date_start,
                until: until,
                tzid: Intl.DateTimeFormat().resolvedOptions().timeZone,
              })
github grover / homebridge-calendar / test / CalendarActionBuilderWithOffset.spec.js View on Github external
'foo': {
      type: 'VEVENT',
      summary: 'Test',
      start: new Date(2018, 0, 30, 10, 0, 0, 0),
      end: new Date(2018, 0, 30, 10, 15, 0, 0),
    }
  };

  const recurringEvent = {
    'foo': {
      type: 'VEVENT',
      summary: 'Test',
      start: new Date(2018, 0, 30, 10, 0, 0, 0),
      end: new Date(2018, 0, 30, 10, 15, 0, 0),
      rrule: new RRule({
        freq: RRule.DAILY,
        dtstart: new Date(2018, 0, 30, 10, 0),
        until: new Date(new Date().getFullYear() + 1, 0, 30, 10, 0)
      })
    }
  };

  it('Move start of non-recurring event for 2d offset', () => {
    const expectedActions = [
      {
        date: new Date(2018, 0, 28, 10, 0, 0, 0),
        expires: oneEvent.foo.end,
        state: true,
        summary: oneEvent.foo.summary
      }, {
        date: oneEvent.foo.end,
        expires: oneEvent.foo.end,
github grover / homebridge-calendar / test / CalendarActionBuilder.spec.js View on Github external
'bar': {
      type: 'VEVENT',
      summary: 'Test2',
      start: new Date(2018, 0, 30, 11, 0, 0, 0),
      end: new Date(2018, 0, 30, 11, 15, 0, 0),
    }
  };

  const recurringEvent = {
    'foo': {
      type: 'VEVENT',
      summary: 'Test',
      start: new Date(2018, 0, 30, 10, 0, 0, 0),
      end: new Date(2018, 0, 30, 10, 15, 0, 0),
      rrule: new RRule({
        freq: RRule.DAILY,
        dtstart: new Date(2018, 0, 30, 10, 0),
        until: new Date(new Date().getFullYear() + 1, 0, 30, 10, 0)
      })
    }
  };

  it('Builds a start and end action for a single non-recurring event', () => {

    const expectedActions = [
      {
        date: oneEvent.foo.start,
        expires: oneEvent.foo.end,
        state: true,
        summary: oneEvent.foo.summary
      }, {
        date: oneEvent.foo.end,
github chef / automate / components / automate-ui / src / app / pages / job-edit / job-edit.component.ts View on Github external
minute: defaultStart.minute()
        })
      }),
      end: this.fb.group({
        datetime: this.fb.group({
          month: defaultEnd.month(),
          date: defaultEnd.date(),
          year: defaultEnd.year(),
          hour: defaultEnd.hour(),
          minute: defaultEnd.minute()
        }),
        include: false
      }),
      repeat: this.fb.group({
        interval: 1,
        freq: RRule.DAILY,
        include: false
      })
    });
    const form = this.fb.group({
      id: '',
      nodesGroup,
      profilesGroup,
      scheduleGroup
    });

    observableCombineLatest([
        this.managers$,
        this.profiles$,
        this.job$
      ]).pipe(
      takeUntil(this.isDestroyed),
github magda-io / magda / magda-web-client / src / Components / Dataset / Add / AccrualPeriodicityInput / index.tsx View on Github external
const REPEAT_OPTIONS = [
    {
        label: "Year",
        value: RRule.YEARLY
    },
    {
        label: "Month",
        value: RRule.MONTHLY
    },
    {
        label: "Week",
        value: RRule.WEEKLY
    },
    {
        label: "Day",
        value: RRule.DAILY
    },
    {
        label: "Hour",
        value: RRule.HOURLY
    }
];

const DEFAULT_CUSTOM_INPUT_VALUE = {
    interval: 1,
    freq: RRule.WEEKLY,
    byweekday: [RRule.MO] as Weekday[]
};

const AccrualPeriodicityInput: FunctionComponent = props => {
    const recurrenceRuleOptions = props.accrualPeriodicityRecurrenceRule
        ? RRule.parseString(props.accrualPeriodicityRecurrenceRule)
github chef / automate / components / automate-ui / src / app / pages / job-add / job-add.component.ts View on Github external
minute: defaultStart.minute()
        })
      }),
      end: this.fb.group({
        datetime: this.fb.group({
          month: defaultEnd.month(),
          date: defaultEnd.date(),
          year: defaultEnd.year(),
          hour: defaultEnd.hour(),
          minute: defaultEnd.minute()
        }),
        include: false
      }),
      repeat: this.fb.group({
        interval: 1,
        freq: RRule.DAILY,
        include: false
      })
    });

    this.form = this.fb.group({
      nodesGroup,
      profilesGroup,
      scheduleGroup
    });

    this.managers$.pipe(
      takeUntil(this.isDestroyed))
      .subscribe(managers => {
        const managersArray = nodesGroup.controls['managers'] as FormArray;

        managers.forEach((manager, i) => {
github bcgov / queue-management / frontend / src / booking / booking-blackout-modal.vue View on Github external
selectedLength: 0,
          room_id_list: [],
          room_fields: ['selected', 'title'],
          single_booking_blackout_boolean: true,
          recurring_booking_blackout_boolean: true,
          selected_booking_frequency: [],
          selected_booking_weekdays: [],
          selected_booking_count: '',
          recurring_booking_start_time: null,
          recurring_booking_end_time: null,
          recurring_booking_start_date: null,
          recurring_booking_end_date: null,
          yearly: RRule.YEARLY,
          monthly: RRule.MONTHLY,
          weekly: RRule.WEEKLY,
          daily: RRule.DAILY,
          monday: RRule.MO,
          tuesday: RRule.TU,
          wednesday: RRule.WE,
          thursday: RRule.TH,
          friday: RRule.FR,
          booking_rrule_array: [],
          booking_rrule_text: '',
          single_input_boolean: false,
          recurring_input_boolean: false,
          recurring_form_state: '',
          single_form_state: ''
        }
      },
      methods: {
github bcgov / queue-management / frontend / src / booking / other-booking-modal.vue View on Github external
rate: null,
        start:'',
        end:'',
        other_recurring_start_time: null,
        other_recurring_end_time: null,
        other_recurring_start_date: null,
        other_recurring_end_date: null,
        other_recurring_display_time: null,
        other_recurring_display_date: null,
        other_selected_frequency: [],
        other_selected_weekdays: [],
        other_selected_count: '',
        yearly: RRule.YEARLY,
        monthly: RRule.MONTHLY,
        weekly: RRule.WEEKLY,
        daily: RRule.DAILY,
        monday: RRule.MO,
        tuesday: RRule.TU,
        wednesday: RRule.WE,
        thursday: RRule.TH,
        friday: RRule.FR,
        other_single_event: true,
        other_recurring_event: true,
        other_rrule_text: '',
        other_rrule_array: [],
        recurring_title: '',
        recurring_contact_information: '',
        recurring_fees: '',
        single_input_boolean: false,
        recurring_input_boolean: false,
        recurring_form_state: '',
        submitting_flag: false,