Ask Question Date Validation

(kurt) #1

Hi,

Am I right that the date validation does not accept any relative dates? So if I were to ask a question “When do you want to go to the movies” my user would have to enter “11/15/16” as the only valid form of date?

It would be super useful for this to accept things like “today” “tomorrow” “Saturday” and so on.

(John Jackson) #2

You’re correct actually, but I agree it would be better to accept relative dates. In the meantime, you could accept anything then use the Date & Time > Format Date action.

We’re working in this area very soon and will be improving.

(kurt) #3

So if I accept anything, that’s fine, but I don’t think Format Date action can help tell whether it’s a relative date, right?

I’m eventually passing this over to our API via webhook, but before I do, it would be nice to know whether a date was actually provided by the user. Is the Format Date able to parse a “Friday” as 11/5/2016 or “Tomrorow” etc? Right now it seems to just error and then stop.

(John Jackson) #4

That should take human readable dates, such as “friday” and turn that into “11/5/2016”.

The docs link to a 404 page but that should be an online tool where you can see how a ‘relative’ date is handled (we use the date formatting code from the SugarJS library). Unfortunately they revamped the site and our links are broken :frowning2:

If “friday” isn’t handled, does “next friday” work, I know for sure that should?

This will be prioritised as we need to make sure this is handled better.