đ Date Picker
Display a native date, time, or date and time picker in your app.
What is Date Picker?
The Date Picker feature lets you show a native date and time selection UI - the same picker the user sees in other apps on their device. It supports three modes: date only, time only, or date and time combined. The result is returned as a timestamp in milliseconds, which you can convert to any date format your app needs.
Prerequisites
Implementation
Choose your integration method below: Bubble.io Plugin (No-Code), JavaScript SDK (Code), or AI Agents (for AI-powered editors like Lovable, Base44, and Replit).
Initialization
Check Plugin
Before starting, verify if the Natively plugin is already installed in your Bubble project.
Open your Bubble editor and navigate to the Plugins tab in the left sidebar.
Check Installed Plugins: Look through your list of installed plugins for "Natively iOS & Android app builder".
If it IS installed: Check the version number. If an update is available (e.g., you see a button saying "Update"), click it to ensure you have the latest features and bug fixes.

If it is NOT installed: Click the + Add plugins button, search for "Natively", and click Install.

Check SDK
Before writing any logic, ensure the Natively SDK is correctly installed and up-to-date in your codebase.
Open your project's main HTML file (or header settings) and look for the Natively script tag inside the
<head>section.Install/Update: If missing or outdated, add the following code. You can specify the SDK version in the URL (e.g.,
@2.26.0).
Initialize the SDK
AI-powered editors like Lovable, Base44, and Replit use the JavaScript SDK to implement Natively features. Before implementing any feature, the Natively SDK must be initialized in your project.
Copy the line below and paste it into your AI agent to check and set up the Natively SDK in your project.
Setup Logic
[Element] Natively - Date Picker
Events:
Date selected
Date Picker closed
States:
Selected Date
Actions:
Show Date Picker
Title - label shown at the top of the picker.
Description - optional subtitle shown below the title (iOS only - may not have a visible effect on Android).
Type -
DATE,TIME, orDATE_AND_TIME.Style -
DARKorLIGHT.
AI-powered editors like Lovable, Base44, and Replit use the JavaScript SDK to implement Natively features.
Copy the line below and paste it into your AI agent.
How to use
Choose the right type
Use DATE for date-only inputs like birthdays or booking dates, TIME for scheduling or time-based inputs, and DATE_AND_TIME when you need both - for example, scheduling a meeting or setting a reminder.
Converting the timestamp
The picker returns milliseconds since epoch via resp.date. Convert it to a JavaScript Date object with new Date(Number(resp.date)). From there, you can format it however your app needs - as a readable string, store it in your database, or pass it to another function.
Handling dismissal
If the user closes the picker without selecting a date, resp.date will return an invalid date. Always check with isNaN(date.getTime()) before using the value to avoid passing invalid data to your app logic.
Match the picker style to your app
Use LIGHT or DARK to match your app's visual theme. If your app supports both light and dark modes, consider reading the current mode from Device Info and passing it dynamically to the picker.
Troubleshooting
Last updated