Pedro Caldeira Active Member Licensed User Longtime User Jun 17, 2020 #1 Hello All, I am trying to restraint the period that the user has to pick some days and I am using the DatePickerDialog. However, to set minDate, MaxDate and SelectableDays I must enter the values in java.util.calendar format. How do I do that ? Code: Copy Dim today As Long = DateTime.Now Dim DP As DatePickerDialog DP.Initialize("Date_From_Picker",DateTime.GetYear(today),DateTime.GetMonth(today), DateTime.GetDayOfMonth(today)) DP.MinDate = ?? DP.MaxDate = ?? DP.show("Date_From_Picker")
Hello All, I am trying to restraint the period that the user has to pick some days and I am using the DatePickerDialog. However, to set minDate, MaxDate and SelectableDays I must enter the values in java.util.calendar format. How do I do that ? Code: Copy Dim today As Long = DateTime.Now Dim DP As DatePickerDialog DP.Initialize("Date_From_Picker",DateTime.GetYear(today),DateTime.GetMonth(today), DateTime.GetDayOfMonth(today)) DP.MinDate = ?? DP.MaxDate = ?? DP.show("Date_From_Picker")
Erel B4X founder Staff member Licensed User Longtime User Jun 18, 2020 #2 You can do it easily with B4XDateTemplate + B4XDialog. Upvote 0
Pedro Caldeira Active Member Licensed User Longtime User Jun 18, 2020 #3 Erel said: You can do it easily with B4XDateTemplate + B4XDialog. Click to expand... I know, but: I need to restraint the days that the user can pick I want the dialog to stay in screen until the user presses OK Can I do that with B4XDateTemplate + B4XDialog ? Upvote 0
Erel said: You can do it easily with B4XDateTemplate + B4XDialog. Click to expand... I know, but: I need to restraint the days that the user can pick I want the dialog to stay in screen until the user presses OK Can I do that with B4XDateTemplate + B4XDialog ?
M Mahares Expert Licensed User Longtime User Jun 18, 2020 #4 Pedro Caldeira said: I want the dialog to stay in screen until the user presses OK Can I do that with B4XDateTemplate + B4XDialog ? Click to expand... Yes. I was able to do it by modifying the class module B4XDateTemplate in the XUI Views library and renaming it to say: myB4XDateTemplate and reference the class module name . Once you do that, you COMMENT a line that starts with Hide. in the class That is how it worked for me. But, Erel may have a simpler method without modifying the class as he always does. Upvote 0
Pedro Caldeira said: I want the dialog to stay in screen until the user presses OK Can I do that with B4XDateTemplate + B4XDialog ? Click to expand... Yes. I was able to do it by modifying the class module B4XDateTemplate in the XUI Views library and renaming it to say: myB4XDateTemplate and reference the class module name . Once you do that, you COMMENT a line that starts with Hide. in the class That is how it worked for me. But, Erel may have a simpler method without modifying the class as he always does.
Erel B4X founder Staff member Licensed User Longtime User Jun 18, 2020 #5 You will need to modify the code for this. As @Mahares wrote, rename it so it will not collide with the internal one. Upvote 0
You will need to modify the code for this. As @Mahares wrote, rename it so it will not collide with the internal one.
M Mahares Expert Licensed User Longtime User Jun 18, 2020 #6 Pedro Caldeira said: How do I access this class ? Click to expand... 1. Make a copy of the internal library: XUI Views.b4xlib 2. Change its extension to zip 3. Unzip it somewhere on your computer. 4. You will see: B4XDateTemplate.bas 5. Change its name to: myB4XDateTemplate.bas 6. Edit myB4XDateTemplate.bas by commenting the line : Hide., then save it. 7. Use it as your class module and refer to it in your code. Do not save it back to XUI VIews.b4xlib and do not modify: XUI VIews.b4xlib Upvote 0
Pedro Caldeira said: How do I access this class ? Click to expand... 1. Make a copy of the internal library: XUI Views.b4xlib 2. Change its extension to zip 3. Unzip it somewhere on your computer. 4. You will see: B4XDateTemplate.bas 5. Change its name to: myB4XDateTemplate.bas 6. Edit myB4XDateTemplate.bas by commenting the line : Hide., then save it. 7. Use it as your class module and refer to it in your code. Do not save it back to XUI VIews.b4xlib and do not modify: XUI VIews.b4xlib
Pedro Caldeira Active Member Licensed User Longtime User Jun 18, 2020 #7 Mahares said: 1. Make a copy of the internal library: XUI Views.b4xlib 2. Change its extension to zip 3. Unzip it somewhere on your computer. 4. You will see: B4XDateTemplate.bas 5. Change its name to: myB4XDateTemplate.bas 6. Edit myB4XDateTemplate.bas by commenting the line : Hide., then save it. 7. Use it as your class module and refer to it in your code. Do not save it back to XUI VIews.b4xlib and do not modify: XUI VIews.b4xlib Click to expand... Thanks Upvote 0
Mahares said: 1. Make a copy of the internal library: XUI Views.b4xlib 2. Change its extension to zip 3. Unzip it somewhere on your computer. 4. You will see: B4XDateTemplate.bas 5. Change its name to: myB4XDateTemplate.bas 6. Edit myB4XDateTemplate.bas by commenting the line : Hide., then save it. 7. Use it as your class module and refer to it in your code. Do not save it back to XUI VIews.b4xlib and do not modify: XUI VIews.b4xlib Click to expand... Thanks