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

Function createRoundedDate

frontend/src/utils/forms/RecordingUtils.js:34–39  ·  view source on GitHub ↗
(minutesAhead = 0)

Source from the content-addressed store, hash-verified

32};
33
34export const createRoundedDate = (minutesAhead = 0) => {
35 let rounded = roundToNearest(getNow(), 30);
36 rounded = setSecond(rounded, 0);
37 rounded = setMillisecond(rounded, 0);
38 return toDate(minutesAhead ? add(rounded, minutesAhead, 'minute') : rounded);
39};
40
41// robust onChange for TimeInput (string or event)
42export const timeChange = (setter) => (valOrEvent) => {

Callers 3

getSingleFormDefaultsFunction · 0.85
getRecurringFormDefaultsFunction · 0.85

Calls 6

roundToNearestFunction · 0.90
getNowFunction · 0.90
setSecondFunction · 0.90
setMillisecondFunction · 0.90
toDateFunction · 0.90
addFunction · 0.90

Tested by

no test coverage detected