MCPcopy Index your code
hub / github.com/MALSync/MALSync / isValidDate

Function isValidDate

src/utils/IntlWrapper.ts:400–405  ·  view source on GitHub ↗
(date: Date | string | number | null | undefined)

Source from the content-addressed store, hash-verified

398}
399
400export function isValidDate(date: Date | string | number | null | undefined): boolean {
401 if (!date) return false;
402 if (typeof date === 'number') return true;
403 const str = typeof date === 'string' ? new Date(date) : date;
404 return str instanceof Date && !Number.isNaN(str.getTime());
405}
406
407export function checkForNow(
408 input: number,

Callers 2

isValidDateMethod · 0.85
getDateTimeTextMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected