Convert Text input to Date (hours)?

Hey guys, I’m in a bit of a pickle here…

So, my client is not happy with the airtime picker, nor the airtimedropper etc and just request a simple input for it. I need an input for opening hours, that is, the user is gonna type only the hours with the am/pm format.

I need to convert that text in to date for the database to work properly. Its okay if I endup with a date like 01-01-1970 hh:MM since I will only grab the hours anyways.
I’m thinking maybe using javascript expression “new Date(‘input’)” but I’m not really a JS dev at all, got confused there. Maybe convert to Json and to look for a timestamp? Does that make some sense?

Does anybody has more experience to guide me here?

Hi there, @vitor370… it couldn’t hurt to give this thread a look… it should help.

Best…
Mike

1 Like

Its okay if I endup with a date like 01-01-1970 hh:MM

In that case, you can do just that (i.e. set an arbritray date of 01-01-1970 and change the hours to the input’s value.

This topic was automatically closed after 70 days. New replies are no longer allowed.