9 years ago
1
Topic

I'm trying to contract an events app, where I need a start date and end date.

Within those I need a start time and end time, for example 10am to 4pm Saturday 1 April is the start date, and 11am to 3pm Sunday 2 April is the end time.

As using the calendar field isn't ideal for collecting times I thought I would use two select drop downs, the first for the hour numbered 1 to 24 and the second for the minutes in four fifteen minute blocks (00,15,30,45).

So there would be an hour select & minute select to collect the start date start time and same again for the start date end time, plus one calendar field to collect the date value.

Now I can pull all these values together using the Concat field (which I've just purchased btw) and store the result as a date time storage. My only issue is getting the format correct for date time so I'm thinking of using two hidden fields with the values of ":" and ":00" to add in the hour/minute separator and the seconds parts to get a proper date time format.

Now assuming you've even kept up with my post so far (!) can I ask if this is a sensible method, or is there another solution, such as JS?

Get a VIP membership
9 years ago
0
Level 1

aaahh well about 10 minute later I realised I didn't need the hidden fields, as you can add characters in the Concat field list like this: [CHARACTER], not forgetting to add the double pipe, which helped me get the date time format I needed.

Additionally I realised that my date field needed to be formatted in the same way as I wanted it to appear in the Concat field storage (Y-m-d).

Would still be interested to hear of any other solutions though.

Get a Book for SEBLOD