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 Entry

Featured Replies

Have a webpage where the date is required to be entered.

The issue is it requires it in mm/dd order it seems.

 

Any way to convert the dd/mm/yyyy while it sends to the database?

 

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...

  • Author

I hate to be a pain but where am I pasting that code?
I assumed in the header of the search results page but I just get a blank white screen.

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

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 ?>

Ah crud - spend too much time in straight FM scripting...

 

Try:

 

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

 

(comma in the middle, not semicolon)

  • Author

Thank you so much. Worked perfectly.

 

Definitely still learning how all this works :S

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

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.