AnotherDatePicker & Time-Picker

devlei

Active Member
Licensed User
Longtime User
Firstly, thank you for the AnotherDatePicker Class - it is really great!

I have a Date/Time label, which when the user clicks, uses the AnotherDatePicker to select the date. Previously I had used other Date Pickers and thereafter a TimePicker to get the Date/Time for the Label.

The problem is that it does not wait for me to select a date before going to the Time Picker. I understand that this is because it is non-modal.

I need to be able to select both Date (from AnotherDatePicker) and Time and combine them into a String which is displayed in the relevant DateFormat in a Label.

From searching the Forum I can see the following options:
  • Modify the AnotherDatePicker class to include a Time-Picker - I have looked at the Class, but my programming skills are too basic to figure it out!!
  • Use the Closed Event of AnotherDatePicker v1.1 - I can't find an example and don't want to change from the Label to CustomView!
  • Use the b4aCVDateTimePicker library - It seems like the Date & Time are separate and not combined into one!

Any advice would be welcome!!

Dave
 

devlei

Active Member
Licensed User
Longtime User
The Wheel Type is fine for the Time Picker, but for the Date Picker most people are familiar with and prefer the calendar-style of the AnotherDatePicker.

I would like to use the AnotherDatePicker first and then a Time Picker, but can't get it right yet because the Time Picker pops up before date is selected.
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
What's the problem.
Look at the attached test project.
- Click on the second Label.
- AnotherDatePicker is displayed
- Select a date
- The Time select wheel is displayed
- Select a time
- Click on OK
- Date and time are displayed in the second label.

Best regards.
 

Attachments

  • Date_Time_Pickers.zip
    17.8 KB · Views: 690
Upvote 0

devlei

Active Member
Licensed User
Longtime User
Thanks, Klaus, you're a star!!

Initially I still had AnotherDatePicker v1.0, but just copied & pasted v1.10 and the Events were not available like they are in your example. I'm sure I'll be able to sort it out from here.

Dave
 
Upvote 0

devlei

Active Member
Licensed User
Longtime User
I cannot seem to get the AnotherDatePicker's Closed event to be available from my Activity. If I go to the example you sent, Klaus, and type in "Sub adp" and hit CTRL+Spacebar, I get the option to select "Sub adpDate_Closed".

However, when I do the same from my Activity the Closed event is not there. I must be overlooking something. I have attached a small example.

Dave
 

Attachments

  • TestADP.zip
    13.5 KB · Views: 298
Upvote 0

klaus

Expert
Licensed User
Longtime User
I cannot seem to get the AnotherDatePicker's Closed event to be available from my Activity. If I go to the example you sent, Klaus, and type in "Sub adp" and hit CTRL+Spacebar, I get the option to select "Sub adpDate_Closed".
In the code I posted you get the proposal of "Sub adpDate_Closed" because it already exists !

Adding the following in your Activity will do it:
B4X:
Sub adpStart_Closed(Canceld As Boolean, Date As Long)
    If Canceld = False Then
        ' your code
    End If
End Sub
Best regarads.
 
Upvote 0
Top