Skip to content

Commit

Permalink
Merge pull request jekip#232 from CodeListener/fix/utils
Browse files Browse the repository at this point in the history
fix(utils): fix type error
  • Loading branch information
jekip authored Apr 11, 2023
2 parents 80729d9 + 1fa35db commit e152882
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utils/dateUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import { format } from 'date-fns';
const DATE_TIME_FORMAT = 'YYYY-MM-DD HH:mm';
const DATE_FORMAT = 'YYYY-MM-DD ';

export function formatToDateTime(date: null, formatStr = DATE_TIME_FORMAT): string {
export function formatToDateTime(date: Date | number, formatStr = DATE_TIME_FORMAT): string {
return format(date, formatStr);
}

export function formatToDate(date: null, formatStr = DATE_FORMAT): string {
export function formatToDate(date: Date | number, formatStr = DATE_FORMAT): string {
return format(date, formatStr);
}

0 comments on commit e152882

Please sign in to comment.