status/lib/utils.js
Romein van Buren 1983f78fba
Initial commit
Signed-off-by: Romein van Buren <romein@vburen.nl>
2022-06-22 17:22:19 +02:00

12 lines
236 B
JavaScript

'use strict';
// Round minutes up to 10 and remove seconds
// e.g. 15:34:51 -> 15:30:00
function roundDate(d) {
d.setMinutes(Math.round(d.getMinutes() / 10) * 10);
d.setSeconds(0, 0);
return d;
}
module.exports = { roundDate };