Timezone adjusting time entered into a form repeat

My typically pattern in dealing with dates and time is to store everything in UTC, have all servers set to UTC, and only manipulate when storing user entered data, or displaying values.

In other words, on insert of data where the user has entered a time value, I convert the local value to UTC on the server, and then store in the DB. Works fine.

However, we don’t have that option when using a form repeat – the values go into the db “as-is”. I thought about converting them at the client, however having extra data inputs inside a form repeat (or an input without a name) will throw an error.

Anybody have a solution for this?

I have not used form repeat much, so below might be incorrect.

I can only think of RunJS as a quick solution. Manipulate the object received in POST to change the date values, and then use the output from this to insert into DB.

This is assuming you are already capturing client system’s timezone in the request to change the value to UTC on server side.

For a better solution, create a custom component.

Yep, that would work. I got stuck in my head that because you can’t set the individual values, that I could not just update the whole array!

Thanks Sid.