B4J Question B4XPreferencesDialog - issue with date field and custom DateFormat

Drago Bratko

Active Member
Licensed User
Longtime User
Example code here :
B4X:
DateTime.DateFormat = "dd.MM.YYYY"
   
pdPaket.Initialize(MainForm.RootPane, "Paket", 300dip, 300dip)
pdPaket.LoadFromJson(File.ReadString(File.DirAssets, "Paket.json"))
pdPaket.DateTemplate.FirstDay = 1
   
Private oPaket As Map
oPaket.Initialize
oPaket.Put("dOd", DateTime.Now)
oPaket.Put("dDo", DateTime.Add(DateTime.Now, 1, 0, 0))
Wait For (pdPaket.ShowDialog(oPaket, "Dodaj", "Odbaci")) Complete (Result As Int)
If Result = xui.DialogResponse_Positive Then
    Log(oPaket)
    Log(DateTime.Date(oPaket.Get("dOd")))
    Log(DateTime.Date(oPaket.Get("dDo")))
End If

If I comment line where date format is set (DateTime.DateFormat = "dd.MM.YYYY"), then all is fine.
If this line is executed, then selected dates are not transfered properly … attached is small example project.

Any ideas ?
 

Attachments

  • test.zip
    1 KB · Views: 214
Top