Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function adapterFactory(moment): DateAdapter {
return {
...baseAdapterFactory(moment),
addWeeks(date: Date | number, amount: number): Date {
return moment(date)
.add(amount, 'weeks')
.toDate();
},
addMonths(date: Date | number, amount: number): Date {
return moment(date)
.add(amount, 'months')
.toDate();
},
subDays(date: Date | number, amount: number): Date {
return moment(date)
.subtract(amount, 'days')