When I click on the calendar, the lesson start time will be the selected date

Hello, I am trying to make an online language learning program, there will be teachers and students in the system. In this system, when people click on that day on the calendar, I want to assign the lesson start date to that day, but when they click on any day, the time date and picker opens as empty, for example, I want to take a training on October 29, I clicked on October 29, but the time and picker came up empty, how can I fill this time and picker with the day that is clicked?

Thanks,


Hello, how are you?
I believe that you are missing the date and time element (source-selected) to the destination element. For example: Source element (selection) date/timePicker, with input type date&time and the destination element text, here in the text in appearence you will call the date/timePicker value, which when selecting the date and time will insert this data in the destination text.

Is there any possibilty to show with screenshot. English is not my first language i can miss some parts thank you :slight_smile:

Seguem as telas… @turkishlinguaorg :facepunch:


tela02

Thanks for your efforts but i think we have some misunderstanding there.

I meant this.

This is my calendar and when someone click on any date on the booking popup i want the calendar display selected date

if someone clicks on 15 october, on the popup’s time date picker must be 15 october and selected hour.

How can i do that?

I finally Founded a solution with Chatgpt’s help;

Here is the Solution:

Goal

We want to create a system where:

  1. A user clicks a date on a calendar (or any clickable area).
  2. The date picker field automatically updates to show that clicked date.

Step-by-Step Guide

Step 1: Add a Custom State to Store the Selected Date

  1. Select Your Calendar or Date Element:
  • Find the element on your Bubble page that the user will click to choose a date (this could be a calendar or a button).
  1. Create a Custom State:
  • Go to the Element Inspector (click on the “i” icon on the calendar element).
  • Click on Add a custom state and name it something easy to remember, like Selected Date.
  • Set the Type of this custom state to Date.

Why we do this: A custom state lets us store data temporarily without having to save it to the database. Here, it will store the date the user clicked.

Step 2: Set Up a Workflow to Capture the Clicked Date

  1. Create the Workflow:
  • Go to the Workflow tab in Bubble (you’ll find this at the top of the screen).
  • Click on Start/Edit Workflow (or Add an Event) and choose When an element is clicked.
  1. Select the Element You Want to Use for Date Selection:
  • Bubble will ask you which element should trigger this workflow. Choose the calendar element or the clickable element that you set up in Step 1.
  1. Add an Action to Store the Clicked Date in the Custom State:
  • After selecting the element, add a new action by clicking + Add an action.
  • Choose Element Actions > Set State.
  • Bubble will now ask you which element’s state you want to change. Select the calendar element where you created the custom state.
  • Select the custom state you created (e.g., Selected Date).
  • In the field for the value, set it to the date the user clicked. For example, it might look like This element’s Current Date (depending on the type of element you’re using).

Why we do this: This step makes sure that when the user clicks on a date, Bubble stores that date in our custom state.

Step 3: Link the Date Picker to Show the Selected Date

  1. Go to Your Date Picker Element:
  • Find the date picker input where you want the selected date to appear.
  1. Set the Date Picker’s Initial Content:
  • With the date picker selected, go to Initial Content in the Property Editor on the left.
  • Set the Initial Content to the custom state you created in Step 1 (e.g., calendar element’s Selected Date).

Why we do this: This makes the date picker automatically update to show whatever date is stored in the custom state.

Step 4: Test It Out

  1. Preview Your Page:
  • Click Preview in Bubble to test your workflow.
  1. Click on a Date:
  • Click on a date in your calendar or clickable element.
  1. Check the Date Picker:
  • Open the date picker and see if it shows the date you clicked.
1 Like

Ah, entendi voce precisa passar os dados para o popup. Isso Ă© feito pelo workFlow. Mas que bom que deu certo. Sucesso!

1 Like

Obrigado

This topic was automatically closed after 70 days. New replies are no longer allowed.