Bulk upload: TIME answers always fail on Sundays (UTC)

Project Name (if applicable, otherwise just type n/a)

Conteo Herpetos Chile 2026

Question

Bulk uploading entries with a TIME question fails with “Date/time format incorrect” (ec5_79) every Sunday (UTC), and works on any other day without changing the file. I think I found the cause in the source code.

In epicollect5-dataviewer, app/utils/reverse-entry-parser.js (case EC5_TIME_TYPE), the date part of the time answer is built with:

const day = ('0' + today.getUTCDay()).slice(-2);

getUTCDay() returns the day of the WEEK (0–6), not the day of the month. On Sundays it returns 0, so the answer becomes e.g. “2026-10-00T20:26:00.000”. The server rule in RuleTimeInput uses Laravel’s “date” validation, and checkdate(10, 0, 2026) is false, so every row fails with ec5_79.

On Monday–Saturday it silently stores a date between 01 and 06 (e.g. “2026-10-02T22:00:00.000” for an upload on Tuesday 20 Oct), which is why the error seems to “go away by itself”.

Suggested fix: use getUTCDate() instead of getUTCDay().

Steps to reproduce:

  1. Form with a TIME question (format HH:mm), bulk uploads enabled.
  2. Upload a CSV with a valid time (e.g. 20:26) on a Sunday (UTC) → “Date/time format incorrect”.
  3. Upload the same unchanged file on any other day → success.

This matches earlier reports, which were all made on Sundays:

Thanks for the great platform!

I confirm I have read the User Guide at docs.epicollect.net

on

I confirm I have searched for an answer in this community.

on

I confirm I have tried asking the same question to Perplexity AI with the tag #epicollect5, but it did not help.

on

Thanks for the report; we will look into it soon.

Nice catch, getUTCDay() vs getUTCDate() is one of those JavaScript Date traps that bites almost everyone once. I’ve hit the same thing in my own project.

While that line gets fixed, it may be worth double checking the month part next to it too: getUTCMonth() is zero-based, so it needs the +1 before padding. Using String(n).padStart(2, ‘0’) for both also reads a bit clearer than the slice trick.

The issue should be fixed now; let us know if not.