Services Plugins FAQs

Air Date/Time V2 - dynamic range

Hi Team,

Im building out a hire app and each hire item has a set amount of days it can be hired for - eg 4.

How can i show/capture this on the date picker element? eg I pick item above and select a date and it auto populates the 4 days.

At the moment i just have start and end dates in my database but open to suggestions!

Thanks

1 Like

Hi @chaddickson83,

I am sorry for the delay over the weekend. :pray:

Thanks for reaching out and for using the Air Date/Time Picker plugin.

To better understand if the plugin is feasible for your scenario, we need additional details about your app configuration, the plugin element setup, the workflow used, and the expected and actual results.

But generally, the easiest way is to block the selected dates or ranges and save those values inside your database.

Hope this helps. :slightly_smiling_face:

Best regards,
Daniel.

Hey Daniel,

No worries!

Here is a video I did outlining the desired result.

I believe it almost needs to be a workflow when date start is selected update date end automatically but the hire items days.

1 Like

Hi @chaddickson83,

Thanks for sharing your project and the video about the date picker in your hire app!

Unfortunately, we don’t have a similar use case on our plugin Demo page, but here are some general guidance I would advise you to follow:

  1. Initial Setup:
  • Ensure your app has the Air Date/Time Picker Plugin installed and properly configured.
  • Have two date pickers in your app interface: one for the start date and one for the end date.
  1. Define Hire Duration for Items:
  • In your database, make sure each hire item has an associated field that specifies its hire duration in days (e.g., 4 days for an item).
  1. Capturing the Start Date:
  • When a user selects a start date for an item using the date picker, this date needs to be captured. You can do this by setting up a workflow that triggers upon the selection of a date.
  1. Calculate the End Date:
  • In the workflow, add an action to calculate the end date. This involves taking the start date and adding the hire duration to it.
  • For instance, if the hire duration is 4 days and the start date is January 1st, the calculation would result in January 5th as the end date.
  1. Update the End Date Picker:
  • Still within the workflow, add an action to set the value of the end date picker to the calculated end date.
  • This can be done by using dynamic data to feed the calculated end date into the end date picker’s value field.
  1. Optional Database Update:
  • If you need to store these dates in your database (for record-keeping or other functionalities), include steps in the workflow to save the start and end dates to the relevant database fields.

Advice: Pay attention to the format of the dates to ensure consistency across your app.

I hope this helps!

If you run into any specific issues or have further questions, feel free to ask for more assistance! :pray:

Best regards,
Daniel.