Jump to content

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

Recommended Posts

Under the hood, FileMaker always wants mm/dd/yyyy

 

It may display it differently but...

 

If the web form input is in dd/mm/yyyy (use a JavaScript date picker for this bit) then you can convert for input:

 

$date_input = $_POST(date);

$date_array = explode ("/"; $date_input);

$date_toFM = $date_array[1]."/".$date_array[0]."/".$date_array[2];

 

And input the $date_toFM variable to the database

 

I think that should work - been a while since I wrote code...

Link to comment
Share on other sites

So I'll assume that you are doing a search on a date, from a search form...

 

The above would need to be in the php section at the top, and before the actual search query, with the search query using the $date_toFM variable for the date part of it...

 

If you paste your code for the search results page, I should be able to check it fairly quickly

Link to comment
Share on other sites

Cool... try:

 

<?php
//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];

$search_bookings_results_find = $Marthakal->newFindCommand('Booking');
//Note Date_start is using the $date_toFM valye from above
$search_bookings_results_findCriterions = array('Date_Start'=>$date_toFM,'Event_Resource'=>$_REQUEST['Event_Resource'],'triprecordnumber'=>$_REQUEST['triprecordnumber'],'payment_receipt no'=>$_REQUEST['payment_receipt_no'],'Status_Option'=>'=='.fmsEscape('Set As Paid'),'Pilot'=>$_REQUEST['Pilot'],);
foreach($search_bookings_results_findCriterions as $key=>$value) {
    $search_bookings_results_find->AddFindCriterion($key,$value);
}
 
fmsSetPage($search_bookings_results_find,'search_bookings_results',50);
 
$search_bookings_results_find->addSortRule('Date_Start',1,FILEMAKER_SORT_DESCEND);
 
$search_bookings_results_result = $search_bookings_results_find->execute();
 
if(FileMaker::isError($search_bookings_results_result)) fmsTrapError($search_bookings_results_result,"searcherror.php");
 
fmsSetLastPage($search_bookings_results_result,'search_bookings_results',50);
 
$search_bookings_results_row = current($search_bookings_results_result->getRecords());
 
$search_bookings_results__ClientBooking_portal = fmsRelatedRecord($search_bookings_results_row, 'Client_Booking');
$search_bookings_results__BookingClients_portal = fmsRelatedRecord($search_bookings_results_row, 'Booking_Clients');
$search_bookings_results__BookingManifest_portal = fmsRelatedRecord($search_bookings_results_row, 'Booking_Manifest');
 

// FMStudio Pro - do not remove comment, needed for DreamWeaver support ?>
Link to comment
Share on other sites

This topic is 3378 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.