Hi, is it possible to save the date with or without a time using the time date picker?, i want to be able to create tasks that have either just a date (task can be done anytime that day), or can have the date and time set. can this be done? if so how?
We use tasks and other date related things in similar ways. There’s a couple of ways to do this. This is what we do…
A few things to note:
You should always store anything time related as a date or date range field.
You can opt to not show the time picker in the Bubble date/time picker.
You can round down dates to 12:00am.
We typically have a dropdown on the ui that asks what type of task it is, and then shows fields appropriately. This also gets stored in the database just so we easily query based on type.
All day things get rounded down to 12:00am before getting stored to the database.
What finitejest said is spot on. Use the “change hours to…” operator and set it to 0.
This way you’ll save the date and time will be 00:00
Dates always have time associated when saved to the database, there is no way to do it otherwise, unless you just save date as text.
When working with dates, if saving from date picker with no time associated it saves as the date with time of 12:00AM, which is the start of the date.
Bubble has lots of operators to extract date/time components or to manipulate.
Remember that dates and time are nothing but numbers, counted usually as the number of milliseconds after or before January 1, 1970 at 12:00AM.
how would i do that?
