Bug? Preferencedialog date format

Status
Not open for further replies.

AllanH

Member
Licensed User
Longtime User
I use the tPreferencesDialog for a few preferences
One is a date
My app is used all round the world so I need it to conform with regional settings.
Locally, I'm dd/MM/yyyy but the preference dialog seems to default to MM/dd/yyyy
I'm loading the dialog from a json


Example:
Sub Class_Globals
Public prefdialog As PreferencesDialog
...

Private Sub B4XPage_Created (Root1 As B4XView)
  prefdialog.Initialize(Root, "Settings", 300dip, 300dip)
  prefdialog.LoadFromJson(File.ReadString(File.DirAssets, "settings.json"))

How do I regionalise the date?

Thanks
 

William Lancee

Well-Known Member
Licensed User
Longtime User
There is a App-wide setting that is used whenever DateTime is used. All B4X libraries involving dates use it.
It also can be changed before DateTime is invoked (and changed back after if needed). The formats can be found in the intellisense prompt.

B4X:
 DateTime.DateFormat = "dd-MM-yyyy"
 
Status
Not open for further replies.
Top