17
Views
5
Comments
Solved by AI
Date Picker not working properly in ios

Hi everyone,

The date picker’s maximum selectable date is set to the current date to prevent selection of future dates. This functionality works as expected on Android but does not behave correctly on iOS.How to solve this issue?

2019-11-11 17-10-24
Manish Jawla
 
MVP
Solution

Please use currdatetime() instead of datetimenow(). I have updated the post as well.


2023-12-26 10-35-28
OutSystems Neo
Staff
AI Generated

The issue with the maximum selectable date not working correctly on iOS for the OutSystems date picker might result from either buggy behavior in previous OutSystems UI versions or specific compatibility issues with the device or browser rendering the date picker.

Here are some steps you can take to troubleshoot and fix the problem:

  1. OutSystems UI Version Compatibility: Ensure that you are using the latest version of the OutSystems UI framework. Some bugs related to the DatePicker functionality were solved in newer releasesDatePicker not working properly.

  2. Proper Date Format and Initialization:

    • Verify that your "MaxDate" is correctly set and formatted. It should follow the supported date format that OutSystems expects, typically yyyy-MM-dd.
    • Based on the information in , your MaxDate was set using CurrDateTime(). Ensure this value does not exceed its expected range and is correctly functioning across iOS devices.
  3. Device-Specific Display Issues: Some iOS browsers might handle HTML5 date inputs differently. Test the feature across multiple browsers (Safari, Chrome, Firefox) on the iOS device to see if the issue is browser-specific.

  4. Adjust CSS or JavaScript Logic:

    • If using custom styles or scripts for the DatePicker, ensure they are compatible with mobile rendering.
    • Verify that no custom scripts alter the MaxDate or other configurations dynamically, leading to an incorrect behavior.
  5. Time Zone and Data Type:

If none of the above steps solve the issue, consider sharing detailed steps to replicate the issue and testing the behavior on a traditional browser debugger or OutSystems service studio emulator to isolate specific client-side issues for iOS.

This answer was AI-generated. Please read it carefully and use the forums for clarifications
2019-11-11 17-10-24
Manish Jawla
 
MVP

Hi @Ruth Pugal ,

In iOS, the Reactive DatePicker evaluates the time part of a DateTime. If MaxDate is set to “today” at 00:00:00, iOS treats the current date as future once the time passes midnight (Android usually ignores the time).

Fix: set MaxDate to the end of today (23:59:59):

DateTimeAddSeconds(  DateTimeAddDays(DateTimeToDate(CurrDatetime()), 1),  -1)

Bind this to the DatePicker MaxDate (or compute it in OnInitialize).

Also check: update to the latest OutSystems UI version and regenerate the mobile app, as iOS DatePicker fixes are delivered via UI/runtime updates.

Hope this helps.

Regards,

Manish Jawla

UserImage.jpg
Ruth Pugal

Hi Manish Jawla ,
The expression shows an error. Could you check it? 

2019-11-11 17-10-24
Manish Jawla
 
MVP
Solution

Please use currdatetime() instead of datetimenow(). I have updated the post as well.


UserImage.jpg
Ruth Pugal

The future values are still visible after using the above method.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.