Quantcast
Channel: Mockaroo Community Forum - Latest posts
Viewing all articles
Browse latest Browse all 2665

How can it get an end_time that depends on the start_time

$
0
0

I have the same question. I’ve tried the following:
time(field(“Check-in Time”)) + hours(random(.1,6))
…but I get the following error when I preview: “error: no implicit conversion of ActiveSupport::Duration into String”

I also tried: field(“Check-in Time”) + minutes(random(5,300))
…which doesn’t error, but gives me today’s date as a result.

So I tried wrapping that whole second thing in a time() wrapper like this: time(field(“Check-in Time”) + minutes(random(1,5)))

This gives me correct results, but the resulting column is in military time rather than showing am/pm like the Check-in time column does.


Viewing all articles
Browse latest Browse all 2665

Trending Articles