All files / utils dateUtils.js

100% Statements 6/6
100% Branches 5/5
100% Functions 1/1
100% Lines 6/6

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 61x 18x 18x 18x 14x 14x
export const normalizeDateTime = (v) => {
  // Stryker disable next-line ConditionalExpression : behavior is identical for falsy v
  if (!v) return v;
  if (/^\d{4}-\d{2}-\d{2}$/.test(v)) return `${v}T00:00:00`;
  return v;
};