Outputting a string of dates inputted via Runway

  • I am creating a calendar on my Runway site which basically shows dates that are unavailable. I have the php and javascript up and running.


    I am now trying to input the actual dates that are unavailable via runway, so the client can enter the dates within the Runway Dashboard.


    The dates are basically a string within the form value field, and hence I’m trying to think of a way to create the string and insert it within the value. Example value="11/04/2019>21/04/2019,17/05/2019>19/05/2019,27/05/2019,28/06/2019,05/06/2019>13/06/2019". The rest of the code uses this value and display within the calendar.


    I thought I could create a shared region which has a <perch:repeater> for multiple dates. This file looks as such…

    HTML: /content/company_profile/company_profile.html
    1. <perch:group label="Unavailable Dates"> <perch:repeater id="unavailable_dates" label="Please list unavailable dates"> <perch:content id="date_from" type="date" label="Start of unavailability" format="d m Y"> <perch:content id="date_to" type="date" label="End of unavailability" format="d m Y" help="Single days require the same date to be inputted in both Start and End of unavailability"> </perch:repeater></perch:group>

    I then created a template to output the result.

    HTML: /content/company_profile/calendar_dates.html
    1. <perch:content id="date_from" type="date">><perch:content id="date_to" type="date">

    I then have a layout to bring all the elements together.

    The result I am getting currently is:

    HTML
    1. <form>
    2. <input id="enteredDates" type="hidden" name="refDates" value=">,">
    3. </form>

    What am hoping to achieve is:

    HTML
    1. <form>
    2. <input id="enteredDates" type="hidden" name="refDates" value="11/04/2019>21/04/2019,17/05/2019>19/05/2019,27/05/2019,28/06/2019,05/06/2019>13/06/2019">
    3. </form>

    The contents of the value field, filled with a string of dates.


    Thanks in advance