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

Function initializeTime

frontend/src/utils/dateTimeUtils.js:21–29  ·  view source on GitHub ↗
(dateTime, format = null, locale = null, strict = false)

Source from the content-addressed store, hash-verified

19export const convertToSec = (dateTime) => dayjs(dateTime).unix();
20
21export const initializeTime = (dateTime, format = null, locale = null, strict = false) => {
22 if (format && locale) {
23 return dayjs(dateTime, format, locale, strict);
24 } else if (format) {
25 return dayjs(dateTime, format, strict);
26 } else {
27 return dayjs(dateTime);
28 }
29}
30
31export const startOfDay = (dateTime) => dayjs(dateTime).startOf('day');
32

Callers 11

formatDurationMinutesFunction · 0.90
ProgramDetailModalFunction · 0.90
mapProgramsByChannelFunction · 0.90
RecordingUtils.jsFile · 0.90
connectedAccessorFunction · 0.90
TVChannelGuideFunction · 0.90
roundToNearestFunction · 0.85
useTimeHelpersFunction · 0.85
toTimeStringFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected