Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (isNumber(value) || isString(value)) {
date = new Date(value);
}
const defaultOptions = {
date,
type: 'date',
input: {
element: this.inputEl,
format: options.format
},
usageStatistics
};
this.datePickerEl = new TuiDatePicker(calendarWrapper, deepMergedCopy(defaultOptions, options));
this.datePickerEl.on('close', () => {
this.focus();
});
}
if (isString(value) && value.length) {
date = new Date(value);
}
const defaultOptions = {
date,
type: 'date',
input: {
element: this.inputEl,
format: options.format
},
usageStatistics
};
this.datePickerEl = new TuiDatePicker(
this.calendarWrapper!,
deepMergedCopy(defaultOptions, options || {})
);
this.datePickerEl.on('change', this.handleChange);
};