types(DatetimePicker): use tsx (#8181)

This commit is contained in:
neverland
2021-02-19 20:21:42 +08:00
committed by GitHub
parent d092d669f2
commit 7daca89102
7 changed files with 77 additions and 47 deletions
+2 -2
View File
@@ -1,8 +1,8 @@
import { isNaN } from './number';
export function isDate(val: Date): val is Date {
export function isDate(val: unknown): val is Date {
return (
Object.prototype.toString.call(val) === '[object Date]' &&
!isNaN(val.getTime())
!isNaN((val as Date).getTime())
);
}