Dropdownselect for Date format in mobile application.

Hi All,

In mobile application

1. I have created the Date and Time Format screen. Where I am using the dropdown-select widget for selecting values : 

dd-mm-yyyy

 mm-dd-yyyy 

 yyyy-mm-dd

2. For that I have already created static entity for date-format as a column where all there values are reside into it on the server side as database entities.

3. I need to used all these date format for users. If user will select any date format then entire application date format  should be change.

4. All these I want to use in our main module on client side locally for display purpose

5. Below is the example which I have shared in image.



Can anyone help me on the same.


Thanks and Regards,

Y.S






Hi Y.S,

Mobile apps follow the device settings for date and time format. That's the best practice, so why would your user in only your app to select a different date and time format?

That said, if you want to implement what you describe:

  1. You need to store the selected Date and Time format in local storage entity or client variables.
  2. Then I would create a FormatDate() and a FormatTime() function that will use the stored format of resp. Date and Time. And use the FormatDateTime built-in function to return the date and time formatted.
  3. Everywhere where you display a date and time you use the FormatDate() and FormatTime() function.

Regards,

Daniel

Hi Daniel,

Thanks for the above details

Actually I am stuck in implementation.

In this above image I want to show by default value as DD/MM/YYYY and when user click on dropdown arrow the selected values should be like this  dd-mm-yyyy, mm-dd-yyyy and yyyy-mm-dd only 3 values which is static entities. But the thing is I am getting duplicate value.

For example : To select OnChange event how I will do the logic implementation.

Kindly help me on this.


Thanks in Advance

Yasmeen Shaikh


Can you share an OML file with your code.

Or is the first option the current value?

Can't share the oml because it's restricted

First option is the default value example in drop-down showing text as Select , same as here taking DD/MM/YYYY

which containing 3 date formats as I had mentioned above(dd-mm-yyyy......so on)


Regards,

YS

Yasmeen Shaikh wrote:

Can't share the oml because it's restricted

First option is the default value example in drop-down showing text as Select , same as here taking DD/MM/YYYY

which containing 3 date formats as I had mentioned above(dd-mm-yyyy......so on)


Regards,

YS

Maybe you can create a separate module with only the code that replicates the problem.