This is my code
In the button sub that calls the calendar this is what I have.
Code:
Sub btnMarcaAula_Click
' para marcar aula precisamos de pedir
' data
' hora de inicio, hora de fim
' aluno (por LA)
' primeiro esconder todos os paineis
DateTime.DateFormat="MM/dd/yyyy"
Panel1.Visible=False
Panel2.Visible=False
Panel3.Visible=False
Panel4.Visible=False
Panel6.Visible=False
Panel7.Visible=False
Panel8.Visible=False
Panel9.Visible=False
Panel10.Visible=False
PanelLerMsg.Visible=False
Panelmsg.Visible=False
Panel5.Visible=True ' mostra o painel do calendário
CsCal.Initialize(Me,"CsCal",100%x,90%y,DateTime.Now)
Panel5.AddView(CsCal.AsView,0,0,Activity.Width,Activity.height)
CsCal.ShowCalendar(True)
End Sub
Then I have
Code:
Sub CsCal_ItemLongClick(dt As Long)
DateTime.DateFormat="MM/dd/yyyy" ' just to make sure again.
CsCal.ShowCalendar(False)
Dim aa,dd,mm As Int
aa=DateTime.GetYear(dt)
dd=DateTime.GetDayOfMonth(dt)
mm=DateTime.GetMonth(dt)
Msgbox( CsCal.NmFullMonth(mm-1) &" "&dd& " " & aa," Data escolhida")
CsCal.ShowCalendar(True)
End Sub
This is the error i receive when I click on a calendar day , and can't understand why.
java.text.ParseException: Unparseable date: "6/13/2013" (at offset 1)
at java.text.DateFormat.parse(DateFormat.java:626)
at anywheresoftware.b4a.keywords.DateTime.DateParse(DateTime.java:147)
at Gesdev4.dev.customcalendar._daypress(customcalendar.java:274)
at Gesdev4.dev.customcalendar._btjour_longclick(customcalendar.java:94)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:169)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:153)
at anywheresoftware.b4a.objects.ViewWrapper$2.onLongClick(ViewWrapper.java:73)
at android.view.View.performLongClick(View.java:4120)
at android.widget.TextView.performLongClick(TextView.java:7875)
at android.view.View$CheckForLongPress.run(View.java:16945)
at android.os.Handler.handleCallback(Handler.java:615)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4745)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)
java.text.ParseException: Unparseable date: "6/13/2013" (at offset 1)