Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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,
}
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)
: DEFAULT_CUSTOM_INPUT_VALUE;
const onWeekDayClick = (
recurrenceRuleOptions: Partial,
weekday: Weekday
) => {
return () => {
const selectedWeekDays: Weekday[] = Array.isArray(
recurrenceRuleOptions.byweekday
)
? (recurrenceRuleOptions.byweekday as Weekday[])
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: {
notes: '',
user_name: '',
user_contact_info: '',
selected_frequency: [],
selected_weekdays: [],
selected_count: '',
recurring_start_time: null,
recurring_end_time: null,
recurring_start_date: null,
recurring_end_date: null,
recurring_array: '',
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,
single_blackout_boolean: true,
recurring_blackout_boolean: true,
rrule_array: [],
rrule_text: '',
recurring_input_boolean: false,
single_input_boolean: false,
next_boolean: false,
single_input_state: '',
recurring_input_state: ''
}
},
methods: {
)}`}
onClick={onWeekDayClick(
recurrenceRuleOptions,
RRule.SU
)}
>
S
<button>
M
</button>
<button>
T
</button>