Date variable is causing app crashed when retrieved


#1

I have a date variable that was selected from date picker object. But when later I want to access that date variable, I couldn’t.

Here’s the step setting the value into the date variable:

This is to retrieve the date variable:
image

This format date to string causes the app crashing. any thought?


#2

I’ve experienced this and i believe its a bug.
It occurs with device variables. Works fine if you save it in a page variable.

When you save a date in a device variable and try to access it by overwriting /reading it, it will cause the app to crash.


#3

Instead of storing the Date object itself, I recommend storing the Date’s timestamp property value instead. You can declare the Device Variable to be of type Long, and store the timestamp property from the Date object returned by Create Date from Parts. From there, you can retrieve that timestamp value as a Device Variable and use the Create Date Object action to recreate the Date object using that timestamp.

We’ll look into supporting Date objects as Device Variables in the meantime, though I can’t give you a timeline on that yet.


#4

Thanks @scheatham for the info on this.
In the meantime it will help new users if this issue is clearly documented somewhere.
Because anyone who isn’t aware of this issue wouldn’t know why their app is crashing.
It took me several hours yesterday to realize this was the cause of a number of complaints here and in the bubble forum about app crashing when sending date to bubble.


#5

I’m glad it’s not only me!