B4A Library DateTimePicker View

rabbitBUSH

Well-Known Member
Licensed User
Thanks for responding....
I thought for some reason that the library in #1 there was still labelled as an earlier version. Il go back and grab it .

I will make a test dummy for you when I get to the machine. But - I probably did something dumb - like not intialising properly etc. etc.. ( so maybe no test dummy necessary - will review it).

Also, thanks for the example. Did make a work around. I wanted a Really simple user input side . I like the whole dialogue look of yours.

What I couldn't get right was a return value from the user selected date (only got the current date back not the one in the header box). I am sure your example will reveal my coding omissions. Maybe it's a documentation thing?

I tried another library before I found yours, but there are issues with how it worked under B4XPages - also couldn't get it's selected date return value.

I'll let you know here what transpires.
?
 

rabbitBUSH

Well-Known Member
Licensed User
Hello again @jtare :
I have 1.14 now.

Sorted out the idiocy on my side which got rid of the "Unknown member" thing.... {{It seems I have a library in the Additional called DateTimePicker 1.01 that caused that problem - turned it off and solved. Now it just sees the Class module DateTimePicker.bas. Incidentally, the 1.01 produced a really nice Month-view dialogue - the one I liked to be using.}} These last comments a probably most relevant to #16 (haven't looked at #17 example yet.).

I thought that there could be an issue with B4XPages and so I redid your example as B4XPages using the flow logic I expect to be using (and which did not work with the other library). SO, that conversion is working. (#11 true)

I could not find how you got the layout in the middle image at the top of #1. I noted (#16) that your intent was to not extend outside of the current year - though obviously that would be workable. Essentially I only need ddmmyyyy no time needed and my date range would be something like 2000->2040. (will figure that out with SetMinDate SetMaxDate -> and unpacking #14 text again and #17 example.)

That's about it. Thanks again for giving me your time and attention, I'll swim upstream from here, Cheers.

(PS seemed there was no necessity to produce a Test Dummy)
 

jtare

Active Member
Licensed User
Longtime User
I could not find how you got the layout in the middle image at the top of #1.
You can achieve that changing the colors. Look this example:

B4X:
DateTimePicker1.SetMinDate(DateTime.Now-DateTime.TicksPerDay*15)
DateTimePicker1.SetMaxDate(DateTime.Now+DateTime.TicksPerHour*13)
DateTimePicker1.SetSelectedValue(DateTime.Now)

DateTimePicker1.backgroundColor = Colors.Black
DateTimePicker1.focusedTextColor = Colors.White
DateTimePicker1.lineColor = Colors.Yellow
DateTimePicker1.fadeAwayEffect = True 'New

DateTimePicker1.Show

I hope it helps
 

Sergey_New

Well-Known Member
Licensed User
Longtime User
It should be possible. Try changing the layout under Base_Resize
I ask you to make the necessary changes. I can't do anything. I only need the hour and minute fields and nothing more.
 

jtare

Active Member
Licensed User
Longtime User
Thanks, I'll wait!
I have attached the demo project with the requested changes to show just hour and minute fields. Please try it and let me know if there is any issues.

In this version you can change between Datetime picker and Time picker by selecting your choice in the designer custom properties:

 

Attachments

  • DatetimePicker_v1_5_custom.zip
    14.3 KB · Views: 116

Sergey_New

Well-Known Member
Licensed User
Longtime User
Please try it and let me know if there is any issues.
I tried it, in Time mode everything works, but in DateTime mode an error occurs.
There is a wish that the “:” symbol for separating hours and minutes would be reflected and the scrolling would be endless.
 

jtare

Active Member
Licensed User
Longtime User
but in DateTime mode an error occurs.
Make sure you are passing the min and max date in Datetime mode:
B4X:
DateTimePicker1.SetMinDate(DateTime.Now-DateTime.TicksPerDay*15) 'Requiered only for Picker Type: Datetime
DateTimePicker1.SetMaxDate(DateTime.Now+DateTime.TicksPerHour*13) 'Requiered only for Picker Type: Datetime
 

Sergey_New

Well-Known Member
Licensed User
Longtime User
Make sure you are passing the min and max date in Datetime mode
Understood. It's just that in your example these lines were commented out.
Can we expect your decision regarding the proposals? Thank you!
 

Sergey_New

Well-Known Member
Licensed User
Longtime User
but it will take me some time.
I will wait as long as you need.
I also ask you to consider the possibility:
- change the font size and, accordingly, the height of lines,
- set the minimum required DateTimePicker width.
Sorry for bothering.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…