review-edit-auto
Version:
scan your project, only review edited code in given time-range automatic
14 lines (11 loc) • 357 B
text/typescript
const dayjs = require('dayjs');
const isAfter = (date: string, since: string): boolean => {
if (since.indexOf('week') > 0) {
const num = since.split('.')[0];
const sinceDate = dayjs().subtract(num, 'week');
return dayjs(date).isAfter(dayjs(sinceDate));
} else {
return dayjs(date).isAfter(dayjs(since));
}
};
export default isAfter;