Aligned to DEV changes performed manually
This commit is contained in:
parent
321cb49a22
commit
5052f17686
|
@ -14,11 +14,11 @@ this.ckan.module('daterangepicker-module', function ($, _) {
|
||||||
|
|
||||||
// Populate the datepicker and hidden fields
|
// Populate the datepicker and hidden fields
|
||||||
if (param_start) {
|
if (param_start) {
|
||||||
$('#datepicker #start').val(moment.utc(param_start).year());
|
$('#datepicker #start').val(moment.utc(param_start).format());
|
||||||
$('#ext_startdate').val(param_start);
|
$('#ext_startdate').val(param_start);
|
||||||
}
|
}
|
||||||
if (param_end) {
|
if (param_end) {
|
||||||
$('#datepicker #end').val(moment.utc(param_end).year());
|
$('#datepicker #end').val(moment.utc(param_end).format());
|
||||||
$('#ext_enddate').val(param_end);
|
$('#ext_enddate').val(param_end);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,9 +37,10 @@ this.ckan.module('daterangepicker-module', function ($, _) {
|
||||||
|
|
||||||
// Add a date-range picker widget to the <input> with id #daterange
|
// Add a date-range picker widget to the <input> with id #daterange
|
||||||
$('#datepicker.input-daterange').datepicker({
|
$('#datepicker.input-daterange').datepicker({
|
||||||
format: "yyyy",
|
format: "yyyy-mm-dd",
|
||||||
startView: 3,
|
startView: 0, //show days
|
||||||
minViewMode: 2,
|
minViewMode: 0,
|
||||||
|
clearBtn: true,
|
||||||
keyboardNavigation: false,
|
keyboardNavigation: false,
|
||||||
autoclose: true
|
autoclose: true
|
||||||
}).on('changeDate', function (ev) {
|
}).on('changeDate', function (ev) {
|
||||||
|
|
|
@ -34,7 +34,11 @@ class DateSearchPlugin(plugins.SingletonPlugin):
|
||||||
|
|
||||||
# Add a date-range query with the selected start and/or end dates into the Solr facet queries.
|
# Add a date-range query with the selected start and/or end dates into the Solr facet queries.
|
||||||
fq = search_params.get('fq', '')
|
fq = search_params.get('fq', '')
|
||||||
fq = '{fq} +extras_PublicationTimestamp:[{sd} TO {ed}]'.format(fq=fq, sd=start_date, ed=end_date)
|
#fq = '{fq} +extras_PublicationTimestamp:[{sd} TO {ed}]'.format(fq=fq, sd=start_date, ed=end_date)
|
||||||
|
|
||||||
|
# Added by Francesco see: https://github.com/geosolutions-it/ckanext-datesearch
|
||||||
|
fq = '{fq} +metadata_modified:[{start_date} TO {end_date}]'.format(fq=fq, start_date=start_date, end_date=end_date)
|
||||||
|
log.info('fq is: '+str(fq))
|
||||||
|
|
||||||
search_params['fq'] = fq
|
search_params['fq'] = fq
|
||||||
|
|
||||||
|
|
|
@ -3,19 +3,27 @@
|
||||||
{% block secondary_content %}
|
{% block secondary_content %}
|
||||||
{% resource 'ckanext-datesearch/moment.js' %}
|
{% resource 'ckanext-datesearch/moment.js' %}
|
||||||
{% resource 'ckanext-datesearch/datepicker.css' %}
|
{% resource 'ckanext-datesearch/datepicker.css' %}
|
||||||
|
{% resource 'ckanext-datesearch/daterange.css' %}
|
||||||
{% resource 'ckanext-datesearch/bootstrap-datepicker.js' %}
|
{% resource 'ckanext-datesearch/bootstrap-datepicker.js' %}
|
||||||
{% resource 'ckanext-datesearch/daterangepicker-module.js' %}
|
{% resource 'ckanext-datesearch/daterangepicker-module.js' %}
|
||||||
|
|
||||||
{# This <section> is the date-range picker widget in the sidebar. #}
|
{# This <section> is the date-range picker widget in the sidebar. #}
|
||||||
<section class="module module-narrow module-shallow">
|
<section class="module module-narrow module-shallow">
|
||||||
<h2 class="module-heading">
|
<h2 class="module-heading">
|
||||||
<i class="icon-medium icon-calendar"></i> {{ _('Publication Year') }}
|
<i class="icon-medium icon-calendar"></i> {{ _('Filter by time') }}
|
||||||
<a href="{{ h.remove_url_param(['ext_startdate', 'ext_enddate']) }}" class="action">{{ _('Clear') }}</a>
|
<a href="{{ h.remove_url_param(['ext_startdate', 'ext_enddate']) }}" class="action">{{ _('Clear') }}</a>
|
||||||
</h2>
|
</h2>
|
||||||
<div class="module-content input-prepend input-daterange" data-module="daterange-query" id="datepicker">
|
<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" id="start" data-module="daterangepicker-module" />
|
<table id="daterange-table">
|
||||||
<span class="add-on" style="border:none;background-color:#ffffff;"> to </span>
|
<tr>
|
||||||
<input type="text" class="input-mini" style="cursor:pointer;" readonly="" name="end" id="end" data-module="daterangepicker-module" />
|
<td><span class="add-on" style="border:none;background-color:#ffffff;">From </span></td>
|
||||||
|
<td><input type="text" class="input-mini" readonly="" name="start" id="start" data-module="daterangepicker-module" /></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><span class="add-on" style="border:none;background-color:#ffffff;">To </span></td>
|
||||||
|
<td><input type="text" class="input-mini" readonly="" name="end" id="end" data-module="daterangepicker-module" /></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue