<%* const calltimes = [ moment().hour(15).minute(13).second(0), moment().hour(8).minute(58).second(0), ];
function getNearestAmbriaEmilyCalltime(format) { const now = moment(); const closestCallTime = calltimes.find((calltime) ⇒ { return now.isBetween(calltime.clone().subtract(20, “minutes”), calltime); }); if (format) { return (closestCallTime || now).format(format); } else { return (closestCallTime || now).toISOString(true); } } -%>
start-time: <%* tR += getNearestAmbriaEmilyCalltime() %> medium: <% tp.system.suggester([‘Skype’, ‘Phone’], [‘Skype’, ‘Phone’], false, ‘Call medium’) %>
Cmd-E to edit this call log
name End Call
type line(3) template
action call with Emily end time
templater true
color red<% await tp.file.move(“/logs/Ambria’s calls with Emily/” + getNearestAmbriaEmilyCalltime(“YYYY-MM-DD HHmmssZZ”)) -%>