Issue with Calendar Date Ranges - Invalid “error” Status Entry Causing Price Calculation Failure

Dear HivePress Support Team,

I hope this message finds you well. I’m writing to report an issue I’ve encountered with the date range calendar functionality in HivePress.

Problem Description

When adding date ranges with custom prices to the booking calendar, I noticed that one of the ranges was automatically saved with:

  • Label: "Solo data di fine\n" (which translates to “End date only”)

  • Status: "error"

This invalid entry (with status:"error") is being saved in the data-ranges attribute and is causing the following issues:

  1. The calendar fails to initialize properly when JavaScript attempts to modify or read this data

  2. Price calculations break because the system cannot parse the invalid label as a numeric value

  3. The booking form becomes unresponsive in certain cases when users try to select dates

Technical Details

The problematic entry in the data-ranges JSON appears as:

json

{
  "start": 1786233600,
  "end": 1786320000,
  "label": "Solo data di fine\n",
  "status": "error"
}

Expected Behavior

  • Range entries with status:"error" should either be:

    • Automatically excluded from the data-ranges attribute when rendered

    • Prevented from being saved in the database in the first place

    • Properly handled by the calendar initialization process

Questions

  1. Is there a specific scenario where status:"error" is intentionally saved for date ranges?

  2. Should this be handled by a filter that excludes status:"error" entries before rendering?

  3. Is there a recommended way to programmatically clean up these invalid entries?

Temporary Workaround

Currently, the only way to resolve this issue is to:

  1. Manually remove the invalid range from the database via SQL query

  2. Or use JavaScript to filter it out (which interferes with calendar initialization)

Neither solution is ideal for a production environment.

I would greatly appreciate your guidance on the proper way to handle this issue. Is there a filter hook I can use to exclude status:"error" entries, or should this be fixed at the core level?

Thank you for your time and assistance. I look forward to your response.

Best regards,

Hi,

Thanks for the report.

Could you please share the detailed steps to reproduce the issue locally? You can either provide a step-by-step guide or record a short screencast to help us understand the issue better.

If possible, please also include your Bookings settings in the screencast or screenshots, as this may help us identify the cause more quickly.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.