<commit_before><%--
  Text field with a date selector.

  @author <NAME>
  @since  06-Jan-2011
--%>

<g:set var="jquerySelector" value="#${pageProperty(name: 'page.label.for').replaceAll('\\.','\\\\\\\\\\.')}"/>

<div class="row">
    <label for="<g:pageProperty name="page.label.for"/>"><g:pageProperty name="page.label"/></label>
    <div class="inp-bg date">
        <g:layoutBody/>
    </div>

    <script type="text/javascript">
        $(function() {
            var options = $.datepicker.regional['${session.locale.language}'];
            if (options == null) options = $.datepicker.regional[''];

            options.dateFormat = "${message(code: 'datepicker.jquery.ui.format')}";
            options.showOn = "both";
            options.buttonImage = "${resource(dir:'images', file:'icon04.gif')}";
            options.buttonImageOnly = true;

            $("${jquerySelector}").datepicker(options);
        });
    </script>
</div>
<commit_msg>Fixed datepicker not initializing in a sliding pane<commit_after><%--
  Text field with a date selector.

  @author <NAME>
  @since  06-Jan-2011
--%>

<g:set var="jquerySelector" value="#${pageProperty(name: 'page.label.for').replaceAll('\\.','\\\\\\\\\\.')}"/>

<div class="row">
    <label for="<g:pageProperty name="page.label.for"/>"><g:pageProperty name="page.label"/></label>
    <div class="inp-bg date">
        <g:layoutBody/>
    </div>

    <script type="text/javascript">
        // wait to initialize the date picker if it's not visible
        setTimeout(
                function() {
                    var options = $.datepicker.regional['${session.locale.language}'];
                    if (options == null) options = $.datepicker.regional[''];

                    options.dateFormat = "${message(code: 'datepicker.jquery.ui.format')}";
                    options.showOn = "both";
                    options.buttonImage = "${resource(dir:'images', file:'icon04.gif')}";
                    options.buttonImageOnly = true;

                    $("${jquerySelector}").datepicker(options);
                },
                $('${jquerySelector}').is(":visible") ? 0 : 500
        );
    </script>
</div>

{'fraction_non_alphanumeric': 0.19678899082568807, 'fraction_numerical': 0.009174311926605505, 'mean_word_length': 2.3709428129829986, 'pattern_counts': {'":': 1, '<': 31, '<?xml version=': 0, '>': 31, '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': '6872973', 'n_tokens_mistral': 665, 'n_tokens_neox': 619, 'n_words': 121}