(statusObj, isEndOfDay)
| 484 | */ |
| 485 | const convertTimestampsToUTC = (obj) => { |
| 486 | const processStatus = (statusObj, isEndOfDay) => { |
| 487 | if (!statusObj || typeof statusObj !== "object") return; |
| 488 | |
| 489 | const { from, until } = statusObj; |
| 490 | |
| 491 | if (from && (typeof from === "string" || typeof from === "number") && String(from).trim() !== "") { |
| 492 | statusObj.from = convertTimestampToUTCStartOrEndOfDay(from, false); |
| 493 | } |
| 494 | |
| 495 | if (until && (typeof until === "string" || typeof until === "number") && String(until).trim() !== "") { |
| 496 | statusObj.until = convertTimestampToUTCStartOrEndOfDay(until, true); |
| 497 | } |
| 498 | }; |
| 499 | |
| 500 | if (Object.prototype.hasOwnProperty.call(obj, "currentStatus")) { |
| 501 | processStatus(obj.currentStatus, false); |
no test coverage detected