Jump to content
Server Maintenance This Week. ×

Date problem again...


This topic is 3368 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Hi folks,

 

I am using:  

<input id="date" class="form-control" type="text" name="Date" data-data-format="dd/mm/yyyy" value="<?php echo date ("d/m/Y", strtotime ($found_flight_row->getField('Date') )); ?>" />

 

which allows me to have a date picker and also display dd/mm/yyyy via the 'strtotime'.

 

What I am trying to do is have an edit query so I can edit the date and submit that.

 

 

On my edit_response page I have the following for the date:

//Setup date to be in US format from AU format
$date_input = $_REQUEST['Date_Start'];
$date_array = explode ("/", $date_input);
$date_toFM = $date_array[1]."/".$date_array[0]."/".$date_array[2];
 
$edit_record_edit = $User->newEditCommand('Flights',$_REQUEST['-recid']);

 

$edit_record_fields = array('Date'=>$date_toFM, etc etc etc etc.......
 
I am getting the date doesn't meet the validation criteria. I am guessing it is being sent as d/m/y maybe to Filemaker. Can someone shed any light on this?
Link to comment
Share on other sites

echo out the $date_input using a date that is obviously incorrect one way or the other

 

echo $date_input;  // 31/12/2015 or 12/31/2015

 

That will then tell you how it is actually being submitted to the handler at least...

 

The $date_toFM function simply breaks the submitted data at each / into an array, which is then rearranged to make it the other format by putting the 2nd item ( $date_array[1] ) in the first position etc...

 

HTH

Webko

Link to comment
Share on other sites

This topic is 3368 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.