<commit_before>{% extends "layout.html" %} {% block page_title %} When was the charge created? {% endblock %} {% block content %}

<main id="content" role="main">
    <!-- alpha banner -->
    <div class="phase-banner-beta">
        <p>
            <strong class="phase-tag">BETA</strong>
            <span>This is a new service – your <a href="../../feedback">feedback</a> will help us to improve it.</span>
        </p>
    </div>
    <!-- main content starts -->
    <a href="type-of-charge" class="link-back" style="margin-bottom:0">Back</a>

    <div class="grid-row">
        <div class="column-two-thirds">
            <h1 class="heading-large" style="margin-top:20px;">When was the charge created? (optional)</h1>


            <form action="#">

                <fieldset>
                    <div class="form-group">
                        <legend class="visually-hidden">When was the charge created?

                        </legend>
                        <span class="form-hint">This is the date when the source document was created.<br>For example, 31 3 2017</span>
                        <div class="form-date">
                            <div class="form-group form-group-day">
                                <label class="form-label" for="startDay">Day</label>
                                <input class="form-control" id="startDay" name="startDay" type="number" pattern="[0-9]*" min="0" max="31" aria-describedby="dob-hint">
                            </div>
                            <div class="form-group form-group-month">
                                <label class="form-label" for="startMonth">Month</label>
                                <input class="form-control" id="startMonth" name="startMonth">
                            </div>
                            <div class="form-group form-group-year">
                                <label class="form-label" for="startYear">Year</label>
                                <input class="form-control" id="startYear" name="startYear" type="number" pattern="[0-9]*" min="0" max="2016">
                            </div>
                        </div>
                    </div>
                </fieldset>
                <p>
                    <a id="dateCreatedButton" class="button" href="search-property" role="button">Continue</a>
                </p>

            </form>
        </div>

        <!-- 		<div class="column-third related-container">

			<aside class="govuk-related-items" role="complementary">
				<hr>


			</aside>

		</div> -->

    </div>

</main>
<script>
    var editCheck = sessionStorage.getItem('editing');
    if (editCheck === 'true') {
        document.getElementById('dateCreatedButton').setAttribute('href', 'charge-summary-new');
    }


    document.getElementById('dateCreatedButton').onclick = function() {
        var startDay = document.getElementById('startDay').value;
        var startMonth = document.getElementById('startMonth').value;
        switch (startMonth) {
            case '1' || '01':
                startMonth = 'January';
                break;
            case '2' || '02':
                startMonth = 'February';
                break;
            case '3' || '03':
                startMonth = 'March';
                break;
            case '4' || '04':
                startMonth = 'April';
                break;
            case '5' || '05':
                startMonth = 'May';
                break;
            case '6' || '06':
                startMonth = 'June';
                break;
            case '7' || '07':
                startMonth = 'July';
                break;
            case '8' || '08':
                startMonth = 'August';
                break;
            case '9' || '09':
                startMonth = 'September';
                break;
            case '10':
                startMonth = 'October';
                break;
            case '11':
                startMonth = 'November';
                break;
            case '12':
                startMonth = 'December';
                break;
            default:
                startMonth;

        }
        var startYear = document.getElementById('startYear').value;
        sessionStorage.setItem('startDay', startDay);
        sessionStorage.setItem('startMonth', startMonth);
        sessionStorage.setItem('startYear', startYear);
    }
</script>
{% endblock %}<commit_msg>Fixed the max attribute for year<commit_after>{% extends "layout.html" %} {% block page_title %} When was the charge created? {% endblock %} {% block content %}

<main id="content" role="main">
    <!-- alpha banner -->
    <div class="phase-banner-beta">
        <p>
            <strong class="phase-tag">BETA</strong>
            <span>This is a new service – your <a href="../../feedback">feedback</a> will help us to improve it.</span>
        </p>
    </div>
    <!-- main content starts -->
    <a href="type-of-charge" class="link-back" style="margin-bottom:0">Back</a>

    <div class="grid-row">
        <div class="column-two-thirds">
            <h1 class="heading-large" style="margin-top:20px;">When was the charge created? (optional)</h1>


            <form action="#">

                <fieldset>
                    <div class="form-group">
                        <legend class="visually-hidden">When was the charge created?

                        </legend>
                        <span class="form-hint">This is the date when the source document was created.<br>For example, 31 3 2017</span>
                        <div class="form-date">
                            <div class="form-group form-group-day">
                                <label class="form-label" for="startDay">Day</label>
                                <input class="form-control" id="startDay" name="startDay" type="number" pattern="[0-9]*" min="0" max="31" aria-describedby="dob-hint">
                            </div>
                            <div class="form-group form-group-month">
                                <label class="form-label" for="startMonth">Month</label>
                                <input class="form-control" id="startMonth" name="startMonth">
                            </div>
                            <div class="form-group form-group-year">
                                <label class="form-label" for="startYear">Year</label>
                                <input class="form-control" id="startYear" name="startYear" type="number" pattern="[0-9]*" min="0" max="2222">
                            </div>
                        </div>
                    </div>
                </fieldset>
                <p>
                    <a id="dateCreatedButton" class="button" href="search-property" role="button">Continue</a>
                </p>

            </form>
        </div>

        <!-- 		<div class="column-third related-container">

			<aside class="govuk-related-items" role="complementary">
				<hr>


			</aside>

		</div> -->

    </div>

</main>
<script>
    var editCheck = sessionStorage.getItem('editing');
    if (editCheck === 'true') {
        document.getElementById('dateCreatedButton').setAttribute('href', 'charge-summary-new');
    }


    document.getElementById('dateCreatedButton').onclick = function() {
        var startDay = document.getElementById('startDay').value;
        var startMonth = document.getElementById('startMonth').value;
        switch (startMonth) {
            case '1' || '01':
                startMonth = 'January';
                break;
            case '2' || '02':
                startMonth = 'February';
                break;
            case '3' || '03':
                startMonth = 'March';
                break;
            case '4' || '04':
                startMonth = 'April';
                break;
            case '5' || '05':
                startMonth = 'May';
                break;
            case '6' || '06':
                startMonth = 'June';
                break;
            case '7' || '07':
                startMonth = 'July';
                break;
            case '8' || '08':
                startMonth = 'August';
                break;
            case '9' || '09':
                startMonth = 'September';
                break;
            case '10':
                startMonth = 'October';
                break;
            case '11':
                startMonth = 'November';
                break;
            case '12':
                startMonth = 'December';
                break;
            default:
                startMonth;

        }
        var startYear = document.getElementById('startYear').value;
        sessionStorage.setItem('startDay', startDay);
        sessionStorage.setItem('startMonth', startMonth);
        sessionStorage.setItem('startYear', startYear);
    }
</script>
{% endblock %}
{'fraction_non_alphanumeric': 0.14342090427331153, 'fraction_numerical': 0.012853760288645846, 'mean_word_length': 1.4381528312259484, 'pattern_counts': {'":': 0, '<': 127, '<?xml version=': 0, '>': 127, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7553106', 'n_tokens_mistral': 2474, 'n_tokens_neox': 2231, 'n_words': 513}