Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Date problem again...

Featured Replies

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?

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

  • Author

Thanks mate

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.