mirror of
https://github.com/youzan/vant.git
synced 2025-10-21 03:11:15 +00:00
9 lines
191 B
TypeScript
9 lines
191 B
TypeScript
import { isNaN } from './number';
|
|
|
|
export function isDate(val: Date): val is Date {
|
|
return (
|
|
Object.prototype.toString.call(val) === '[object Date]' &&
|
|
!isNaN(val.getTime())
|
|
);
|
|
}
|