MCPcopy Create free account
hub / github.com/Dispatcharr/Dispatcharr / asDate

Function asDate

frontend/src/utils/forms/RecordingUtils.js:17–22  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

15import { isNotEmpty } from '@mantine/form';
16
17export const asDate = (value) => {
18 if (!value) return null;
19 if (value instanceof Date) return value;
20 const parsed = new Date(value);
21 return Number.isNaN(parsed.getTime()) ? null : parsed;
22};
23
24export const toIsoIfDate = (value) => {
25 const dt = asDate(value);

Callers 5

toIsoIfDateFunction · 0.85
toDateStringFunction · 0.85
getSingleFormDefaultsFunction · 0.85
RecordingUtils.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected