MCPcopy Create free account
hub / github.com/Moli-X/Resources / dateFormat

Function dateFormat

Script/TBPrice.js:186–191  ·  view source on GitHub ↗
(cellval)

Source from the content-addressed store, hash-verified

184}
185
186function dateFormat(cellval) {
187 const date = new Date(parseInt(cellval.replace("/Date(", "").replace(")/", ""), 10));
188 const month = date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1;
189 const currentDate = date.getDate() < 10 ? "0" + date.getDate() : date.getDate();
190 return date.getFullYear() + "-" + month + "-" + currentDate;
191}
192
193function Qs2Json(url) {
194 var search = url.substring(url.lastIndexOf("?") + 1);

Callers 1

lowerMsgsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected