Sub Initialize(v As VuetifyApp)
...
...
txtDate.WatchDate(page)
End Sub
Private Sub txtDate_Watch
page.FormatDisplayDate("txtDate", "dd/mm/yyyy")
End Sub
Private Sub txtDateStarted_Watch
Log(txtDateStarted.GetValue(page))
End Sub
Sub NiceDate(sdate As String) As String 'ignoredeadcode
Dim sdate As String = BANanoShared.FormatDisplayDate(sdate, "ddd, DD MMM YYYY")
Return sdate
End Sub
page.SetMethod(Me, "nicedate", array("x"))
This is incorrect, you need to pass a valid date and not "txtDate" something like "2022-11-28"page.FormatDisplayDate("txtDate", "dd/mm/yyyy")
Sub Initialize(v As VuetifyApp) 'ignoreDeadCode
vuetify = v
page.Initialize(Me, name)
page.vuetify = vuetify
page.StartPage
path = page.path
'
banano.LoadLayout(page.Here, "jsoncrud")
frmUsers.BindState(page)
frmUsers.BindDataSource(dsUsers)
frmUsers.BindDataTable(dtUsers)
vuetify.AddRoute(page)
page.SetMethod(Me, "nicedate", Array("x"))
End Sub
...
...
Sub NiceDate(sdate As String) As String 'ignoredeadcode
Dim sdate As String = BANanoShared.FormatDisplayDate(sdate, "DD-MM-YYYY")
Return sdate
End Sub
Sub Initialize(v As VuetifyApp) 'ignoreDeadCode
vuetify = v
page.Initialize(Me, name)
page.SetMethod(Me, "nicedate", Array("x"))
page.vuetify = vuetify
page.StartPage
path = page.path
'
banano.LoadLayout(page.Here, "jsoncrud")
frmUsers.BindState(page)
frmUsers.BindDataSource(dsUsers)
frmUsers.BindDataTable(dtUsers)
vuetify.AddRoute(page)
End Sub
...
...
Sub NiceDate(sdate As String) As String 'ignoredeadcode
Dim xdate As String = BANanoShared.FormatDisplayDate(sdate, "DD-MM-YYYY")
Return xdate
End Sub
Can we give it another try, in your code you are adding it after the page is added to the app (.Addroute), it wont work, you need to add it before that.
B4X:Sub Initialize(v As VuetifyApp) 'ignoreDeadCode vuetify = v page.Initialize(Me, name) page.SetMethod(Me, "nicedate", Array("x")) page.vuetify = vuetify page.StartPage path = page.path ' banano.LoadLayout(page.Here, "jsoncrud") frmUsers.BindState(page) frmUsers.BindDataSource(dsUsers) frmUsers.BindDataTable(dtUsers) vuetify.AddRoute(page) End Sub ... ... Sub NiceDate(sdate As String) As String 'ignoredeadcode Dim xdate As String = BANanoShared.FormatDisplayDate(sdate, "DD-MM-YYYY") Return xdate End Sub
Strange, will investigate...With the above change the date appears, but the date format returns to the default one "ddd, DD MMM YYYY". :/
BVAD3 already has a competed i18 translation module as demonstrated on this link.but I cannot use it if not localized to italian.
vuetify.AddDateTranslation("Sun", "iCawe")
vuetify.AddDateTranslation("Mon", "uMvulo")
vuetify.AddDateTranslation("Tue", "uLwesibini")
vuetify.AddDateTranslation("Wed", "uLwesithathu")
vuetify.AddDateTranslation("Thu", "uLwesine")
vuetify.AddDateTranslation("Fri", "uLwesihlanu")
vuetify.AddDateTranslation("Sat", "uMgqibelo")
vuetify.AddDateTranslation("Jan", "EyoMqungu")
vuetify.AddDateTranslation("Feb", "EyoMdumba")
vuetify.AddDateTranslation("Mar", "EyoKwindla")
vuetify.AddDateTranslation("Apr", "uTshaz'iimpuzi")
vuetify.AddDateTranslation("May", "EyeCanzibe")
vuetify.AddDateTranslation("Jun", "EyeSilimela")
vuetify.AddDateTranslation("Jul", "EyeKhala")
vuetify.AddDateTranslation("Aug", "EyeThupha")
vuetify.AddDateTranslation("Sep", "EyoMsintsi")
vuetify.AddDateTranslation("Oct", "EyeDwarha")
vuetify.AddDateTranslation("Nov", "EyeNkanga")
vuetify.AddDateTranslation("Dec", "EyoMnga")
As much as the datasource component is not available yet, this does not stop anyone from using BANano.PHP with their own php scipts enclosing inside withby the way, I'm testing Sithatso Daisy, but i I did not find any datasource component.
i guess is not ready for database crud forms right ?
vuetify.AddRoute(page)
page.SetMethod(Me, "nicedate", Array("x"))
In your test works great, but in mine the field goes blank again. it is strange I only added this few lines of code.You were right, adding of the nicedate should be after Addroute.
B4X:vuetify.AddRoute(page) page.SetMethod(Me, "nicedate", Array("x"))
View attachment 136523
This is because even if you set it before, because of the translations source code "assumed" to be existing, the built in hard coded "nicedate" format is used.
Just tested this and its working fine with your suggestion.
Sub Initialize(v As VuetifyApp) 'ignoreDeadCode
...
vuetify.AddRoute(age)
page.SetMethod(Me, "nicedate", Array("x"))
end sub
Sub NiceDate(sdate As String) As String 'ignoredeadcode
Log("sdate: " & sdate)
Dim sdate As String = BANanoShared.FormatDisplayDate(sdate, "DD-MM-YYYY")
Return sdate
End Sub
mine isB4X:Sub NiceDate(sdate As String) As String 'ignoredeadcode Log("sdate: " & sdate) Dim sdate As String = BANanoShared.FormatDisplayDate(sdate, "DD-MM-YYYY") Return sdate End Sub
Sub NiceDate(sdate As String) As String 'ignoredeadcode
Dim xdate As String = BANanoShared.FormatDisplayDate(sdate, "DD-MM-YYYY")
Return xdate
End Sub
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?