Not quite sure to what subcategory this belongs so hence i’m posting it in the main “need help” category.
I’m trying to make an app where I can add multiple stores (or locations) and have the user select the opening- and closing times when creating the object.
I need to be able to work the these times at a later stage, such as calculating the time I would need to leave to get there if it is a 1h drive.
How would I best achieve this? What kind of data type am I looking to use and what do I use for input (date selector, text) ?
I was thinking to put opening- and closingtime in their own field as a string/text value. Then use some input mask/validation on the entry field. Using a text field however immediatly blocks me from using a timepicker and requires the user to type it in.
I think you can use dropdown time selector, like Google My Business does, and pull data from options. In your options, have a field that represent the number of hours.
When it comes to storing and calculating, you can store the number_of_hours field in a number field. So if the time selected is 08:00, you would store selected option’s number_of_hours, which is going to be 8.