DateCalc Op

DateCalc

Perform date calculations


<p>This Op lets you perform date calculations. Adding and subtracting seconds, minutes, hours, days, months or years to the input date. No dependencies. Sample patch: <a href="https://cables.gl/edit/mzfGGl">https://cables.gl/edit/mzfGGl</a></p>


Full Name
  • Ops.Date.DateCalc
Visibility
  • Core Op - Official cables op
License
  • MIT
Authorgithub


Example Patch DigiClock

Sample patch for DateFormatter and DateCalc

Open In Editor

INPUT PORTS


timestamp (Number)

<p>Unix timestamp. eg. from the DateAndTime op. If empty, current timestamp is used</p>

difference (Number:

<i>integer</i>

)

<p>Number of days / months / .... to add</p>

type index (Number:

<i>integer</i>

)

update (Trigger)

<p>Update time value (not needed if an timestamp input is used)</p>

OUTPUT PORTS


Date (Object)

<p>The calculated date in JS Date format</p>

Timestamp (Number)

<p>The calculated date in timestamp (milliseconds) format</p>


Patches using DateCalc

  • Examples
  • Public
  • My Patches

Known Issues

There is a dependency on moment.js, but it's not used. I can't find where to remove the dependency

Changelog


created opuser avatarGeertVanDamme - 2020-10-27 10:38
added lib: moment.jsuser avatarGeertVanDamme - 2020-10-27 15:17
cloned op from Ops.User.GeertVanDamme.DateCalcuser avatarGeertVanDamme - 2020-11-17 21:39