mirror of
https://github.com/PeWu/topola-viewer.git
synced 2026-07-31 08:01:49 +00:00
Improve code quality
Fix lint warnings
This commit is contained in:
@@ -180,9 +180,5 @@ export function isDateRangeClosed(range: DateRange | undefined): boolean {
|
||||
}
|
||||
|
||||
export function toDateObject(date: TopolaDate): Date {
|
||||
return new Date(
|
||||
date.year !== undefined ? date.year! : 0,
|
||||
date.month !== undefined ? date.month! - 1 : 0,
|
||||
date.day !== undefined ? date.day! : 1,
|
||||
);
|
||||
return new Date(date.year ?? 0, (date.month ?? 1) - 1, date.day ?? 1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user