Jump to content

Times... Again

Recommended Posts

I have some Date inputs on my form. Let's call one dateOne. I set time to TRUE. It has time there to select on the form. Yet if I var_dump \IPS\Request::i()->dateOne, it shows it's only a string of the date with no time! No wonder my validation checks are erroring out. What is going on here?

But if I var_dimp $val from a current input's date field, it correctly has the time in the DateTime object.

The only place I can find an example of IPS comparing times on a form is when they have it all as one input. That would be too messy for my situation, due to 6 times involved.

Link to comment
Share on other sites

Figured it out. var dumped all of request data and see it adds a field with _time such as dateOne_time, in my example.

Again editing to try to get to the point quicker... All I am now asking is if anyone has a great idea for how to compare multiple Date inputs from the form other than replicating code from Date.php formatValue(), using that method directly by loading the file, or comparing them all in the $values = $form->values() check.

That last option is my iopinion of the best way, where I am not having to do the same code as IPS is already doing... to get request data into DateTime objects over and over.

Only problem is then I'll have to put errors at the top of the form instead of by each input. Maybe could at least get $form->error to include all of those errors, though.

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...