Display date selected from a date picker


#1

Hi,

I am designing a date picker element in android platform that appears whenever the placeholder is tapped.
How do i set the date selected from the picker to appear on the placeholder?

Thank you.
Denis


#2

Hi @DenisMutegi, you can access the date picked in the nested event:


#3

@sue

Thanks! Does this mean if you want the entire value (day, month, year) you have to make three variables, and then append strings? Or what is the best practice to get the entire day picked in a string?

Edit: I ended up appending a bunch of strings together and store the final result in a variable and send it off to Bubble like that. It works pretty well.

However, I can’t get the default values for the date picker to work. I have inserted the values for month/day as static numbers and when i put a different year that doesn’t have an effect either. Is there a special way?


#4

Hi Asger, you should be able to use the Create Date From Parts action in the Date Picked event, it returns a Date object that you could then use the Format Date to String action on - however the method you’re using sounds just as good so if that’s working I’d probably stick with it…

Re the default values, I believe those should accept static integer values - is that not working for you?


#5

Yes i was looking at the create date action, but it looks like you need the hour, minute and second as well and without it i got an error. Since i only wanted dates i opted for appending strings. But perhaps i missed something (very possible).

As for the date picker here is what i did:

Here is what i got:


#6

Hm that looks correct to me so not sure why it isn’t working… let me pass this one back to the engineers for some input…!


#7

Hi @sue

Has there been any updates on this? I still can’t pick what the pre-selected date should be. Several people who have tested my app have commented on it

Asger


#8

yeah i just tested setting the initial date and it always uses the current date.
same with a time. Unless we’re both doing something wrong it must be a bug.


#9

Hi guys, apologies for the delay here, I believe this was being investigated by our android team, let me check in on what’s happening.


#10

Just a note that you can use the action without selecting any of the default values, I’ve done that successfully myself.


#11

@sue yes if that’s what one wants then it works.
But there are many cases where you want the date/time picker to be initialized to a previously set date/time that is been pulled from the backend or even from a different page.


#12

Absolutely, have pinged the engineering team to look into it.


#13

Hey folks,

You’re indeed right, there is an issue with the Date Picker plugin which isn’t properly considering the selected parameter values for the default date.

I have a fix prepared for this in my local environment and will try to get it deployed either today or tomorrow.

Sorry for the delay, and thank you for the report!


#14

I’ve deployed the fix for this. Let us know if you run into any issues with it!


#15

Thanks @scheatham, i just checked and the date picker works.
Unfortunately the time picker doesn’t work. Don’t know if you deployed a fix for the time picker too.


#16

Ah, I’m able to confirm the issue there as well. I pushed out a fix for it a few moments ago. It should be working now.


#17

The time picker works too now. Thanks


#18

Thanks @scheatham and @sue :slight_smile: