Add id to input fields and use that for jQuery

This commit is contained in:
Mikael Karlsson 2014-10-01 09:55:54 +03:00
parent ae56bc2abf
commit 3ded089b8e
2 changed files with 4 additions and 4 deletions

View File

@ -14,11 +14,11 @@ this.ckan.module('daterangepicker-module', function ($, _) {
// Populate the datepicker and hidden fields
if (param_start) {
$('input[name="start"]').val(moment.utc(param_start).years());
$('#datepicker #start').val(moment.utc(param_start).years());
$('#ext_startdate').val(param_start);
}
if (param_end) {
$('input[name="end"]').val(moment.utc(param_end).years());
$('#datepicker #end').val(moment.utc(param_end).years());
$('#ext_enddate').val(param_end);
}

View File

@ -13,9 +13,9 @@
<a href="{{ h.remove_url_param(['ext_startdate', 'ext_enddate']) }}" class="action">{{ _('Clear') }}</a>
</h2>
<div class="module-content input-prepend input-daterange" data-module="daterange-query" id="datepicker">
<input type="text" class="input-mini" style="cursor:pointer;" readonly="" name="start" data-module="daterangepicker-module" />
<input type="text" class="input-mini" style="cursor:pointer;" readonly="" name="start" id="start" data-module="daterangepicker-module" />
<span class="add-on" style="border:none;background-color:#ffffff;">&nbsp;&nbsp;to&nbsp;&nbsp;</span>
<input type="text" class="input-mini" style="cursor:pointer;" readonly="" name="end" data-module="daterangepicker-module" />
<input type="text" class="input-mini" style="cursor:pointer;" readonly="" name="end" id="end" data-module="daterangepicker-module" />
</div>
</section>