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

Function getSingleFormDefaults

frontend/src/utils/forms/RecordingUtils.js:93–107  ·  view source on GitHub ↗
(recording = null, channel = null)

Source from the content-addressed store, hash-verified

91 : item.name || `Channel ${item.id}`;
92
93export const getSingleFormDefaults = (recording = null, channel = null) => {
94 const defaultStart = createRoundedDate();
95 const defaultEnd = createRoundedDate(60);
96 return {
97 channel_id: recording
98 ? `${recording.channel}`
99 : channel
100 ? `${channel.id}`
101 : '',
102 start_time: recording
103 ? asDate(recording.start_time) || defaultStart
104 : defaultStart,
105 end_time: recording ? asDate(recording.end_time) || defaultEnd : defaultEnd,
106 };
107};
108
109export const getRecurringFormDefaults = (channel = null) => {
110 const defaultStart = createRoundedDate();

Callers 2

RecordingModalFunction · 0.90

Calls 2

createRoundedDateFunction · 0.85
asDateFunction · 0.85

Tested by

no test coverage detected