mirror of
https://github.com/estruyf/vscode-front-matter.git
synced 2026-07-06 09:51:29 +02:00
validate date
This commit is contained in:
@@ -41,7 +41,7 @@ export class DateHelper {
|
||||
}
|
||||
|
||||
public static isValid(date: any): boolean {
|
||||
return !isNaN(date.getTime());
|
||||
return date instanceof Date && !isNaN(date?.getTime());
|
||||
}
|
||||
|
||||
public static tryFormatParse(date: string, format: string): Date | null {
|
||||
|
||||
Reference in New Issue
Block a user