title: DatePicker Editor Template
body: <p>Below is an EditorTemplate that renders a Bootstrap datetimepicker with <code>EditorFor</code> helpers, the problem I am seeing is with the script section. It works OK for one <code>DateTimePicker</code> per view - but since I am using class selector, whenever I use 2 or more <code>DateTimePicker</code>s per view it renders duplicate <code>&lt;script&gt;</code> sections, confusing the DOM as to on which <code>TextBox</code> to invoke the calendar. What am I missing here? </p>
  
  <pre><code>   @model DateTime?
     &lt;div class='input-group date datePicker'&gt;
        &lt;span class="input-group-sm"&gt;
           @Html.TextBox("", Model.HasValue ? Model.Value.ToString("d") : String.Empty)
        &lt;/span&gt;
     &lt;/div&gt;
     &lt;script type="text/javascript"&gt;
         $(function() {
         $('.datePicker').datetimepicker({
             pickTime: false
         });
     });
     &lt;/script&gt;
  </code></pre>