Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
let end_year = parseInt(moment(this.recurring_booking_end_date).clone().format('YYYY'))
let end_month = parseInt(moment(this.recurring_booking_end_date).clone().format('MM'))
let end_day = parseInt(moment(this.recurring_booking_end_date).clone().format('DD'))
//let end_hour = parseInt(moment(this.recurring_booking_end_time).utc().clone().format('HH'))
//let end_minute = parseInt(moment(this.recurring_booking_end_time).utc().clone().format('mm'))
let duration = moment.duration(moment(this.recurring_booking_end_time).diff(moment(this.recurring_booking_start_time)))
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))
let end_year = parseInt(moment(this.recurring_end_date).utc().clone().format('YYYY'))
let end_month = parseInt(moment(this.recurring_end_date).utc().clone().format('MM'))
let end_day = parseInt(moment(this.recurring_end_date).utc().clone().format('DD'))
let end_hour = parseInt(moment(this.recurring_end_time).utc().clone().format('HH'))
let end_minute = parseInt(moment(this.recurring_end_time).utc().clone().format('mm'))
let duration = moment.duration(moment(this.recurring_end_time).diff(moment(this.recurring_start_time)))
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,
let end_day = parseInt(moment(this.other_recurring_end_date).utc().clone().format('DD'))
//let end_hour = parseInt(moment(this.other_recurring_end_time).utc().clone().format('HH'))
//let end_minute = parseInt(moment(this.other_recurring_end_time).utc().clone().format('mm'))
let duration_start = moment(this.other_recurring_start_time).utc()
let duration_end = moment(this.other_recurring_end_time).utc()
let duration = moment.duration(duration_end.diff(duration_start))
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,
onAccrualPeriodicityChange?: (accrualPeriodicity: string) => void;
onAccrualPeriodicityRecurrenceRuleChange?: (
accrualPeriodicityRecurrenceRule: string
) => void;
accrualPeriodicity?: string;
accrualPeriodicityRecurrenceRule?: string;
}
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 = {
added: 0,
invoice: null,
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,
blackout_date: null,
start_time: null,
end_time: null,
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: ''
user_contact_info: '',
selected: [],
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: {