Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
lang: {
days: ['S', 'M', 'T', 'W', 'T', 'F', 'S'],
},
min: '01/1/2008',
max: '01/1/2068',
format: date =>
date
.toLocaleDateString('en-US', {
month: '2-digit',
day: '2-digit',
year: 'numeric',
})
.replace(/[^ -~]/g, ''),
};
const dp = TinyDatePicker(input, Object.assign(tdpConfig, config));
dp.on('select', () => {
let event;
if (typeof Event === 'function') {
event = new Event('input');
} else {
event = document.createEvent('Event');
event.initEvent('input', true, true);
}
input.dispatchEvent(event);
input.focus();
});
};
days: ['S', 'M', 'T', 'W', 'T', 'F', 'S']
},
min: '01/1/2008',
max: '01/1/2068',
format: date =>
date
.toLocaleDateString('en-US', {
month: '2-digit',
day: '2-digit',
year: 'numeric'
})
.replace(/[^ -~]/g, '')
};
if (TinyDatePicker) {
TinyDatePicker(input, {
...tdpConfig,
...this.sprkDatePickerConfig
}).on('select', () => {
this.ref.nativeElement.dispatchEvent(new Event('input'));
this.ref.nativeElement.focus();
});
}
}
}
componentDidMount() {
const { datePickerConfig } = this.props;
TinyDatePicker(
this.datePickerInputRef.current,
assign(this.tdpConfig, datePickerConfig),
);
}
days: ['S', 'M', 'T', 'W', 'T', 'F', 'S']
},
min: '01/1/2008',
max: '01/1/2068',
format: date =>
date
.toLocaleDateString('en-US', {
month: '2-digit',
day: '2-digit',
year: 'numeric'
})
.replace(/[^ -~]/g, '')
};
if (TinyDatePicker) {
TinyDatePicker(input, {
...tdpConfig,
...this.sprkDatePickerConfig
}).on('select', () => {
this.ref.nativeElement.dispatchEvent(new Event('input'));
this.ref.nativeElement.focus();
});
}
}
}
Template.tracktime.onRendered(() => {
Template.instance().tinydatepicker = TinyDatePicker('#date', {
format(date) {
return date ? moment(date).format('ddd, DD.MM.YYYY') : moment().format('ddd, DD.MM.YYYY')
},
parse(date) {
return moment(date, 'ddd, DD.MM.YYYY')
},
mode: 'dp-modal',
dayOffset: 1,
}).on('select', (_, dp) => {
if (!dp.state.selectedDate) {
$('#date').val(moment().format('ddd, DD.MM.YYYY'))
}
})
})
Template.tracktime.onCreated(function tracktimeCreated() {
componentDidMount() {
const { datePickerConfig } = this.props;
TinyDatePicker(this.datePickerInputRef.current, assign(this.tdpConfig, datePickerConfig));
}
days: ['S', 'M', 'T', 'W', 'T', 'F', 'S']
},
min: '01/1/2008',
max: '01/1/2068',
format: date =>
date
.toLocaleDateString('en-US', {
month: '2-digit',
day: '2-digit',
year: 'numeric'
})
.replace(/[^ -~]/g, '')
};
if (TinyDatePicker) {
TinyDatePicker(input, {
...tdpConfig,
...this.sprkDatePickerConfig
}).on('select', () => {
let event;
if (typeof(Event) === 'function') {
event = new Event('input');
} else {
event = document.createEvent('Event');
event.initEvent('input', true, true);
}
this.ref.nativeElement.dispatchEvent(event);
this.ref.nativeElement.focus();
});