Bubble doesn’t have a native “convert to date” expression so when you’re using a ternary expression (i.e. format as text) and you want to input a default date, it’s not as easy as you might think.
e.g. If you want to create a new Thing with a default of today’s date (e.g. when no date is selected for your Thing) you can try the equivalent of:
DateSelector.value.is_empty ? CurrentDateTime : DateSelector.value
And it will complain that it’s expecting a date but you’ve given text.
Solution?
Toolkit to the rescue…
- Drop an “expression” element on your page
- Put the expression within new Date (‘’)
- Use that Expression.value in your workflow instead of your input’s
- Bask in the feeling of you solving something using Javascript in your no-code app
Hope it helps.