Commit 62f76747 authored by OzzieIsaacs's avatar OzzieIsaacs

fixed #410 advanced search for publishing date

fixed misstyping in italian language
removed next to "me" after login
parent 6a2449ff
......@@ -29,6 +29,40 @@ if ($("#description").length) {
}
}
if (!Modernizr.inputtypes.date) {
$("#Publishstart").datepicker({
format: "yyyy-mm-dd",
language: language
}).on("change", function () {
// Show localized date over top of the standard YYYY-MM-DD date
var pubDate;
var results = /(\d{4})[-\/\\](\d{1,2})[-\/\\](\d{1,2})/.exec(this.value); // YYYY-MM-DD
if (results) {
pubDate = new Date(results[1], parseInt(results[2], 10) - 1, results[3]) || new Date(this.value);
$("#fake_Publishstart")
.val(pubDate.toLocaleDateString(language))
.removeClass("hidden");
}
}).trigger("change");
}
if (!Modernizr.inputtypes.date) {
$("#Publishend").datepicker({
format: "yyyy-mm-dd",
language: language
}).on("change", function () {
// Show localized date over top of the standard YYYY-MM-DD date
var pubDate;
var results = /(\d{4})[-\/\\](\d{1,2})[-\/\\](\d{1,2})/.exec(this.value); // YYYY-MM-DD
if (results) {
pubDate = new Date(results[1], parseInt(results[2], 10) - 1, results[3]) || new Date(this.value);
$("#fake_Publishend")
.val(pubDate.toLocaleDateString(language))
.removeClass("hidden");
}
}).trigger("change");
}
/*
Takes a prefix, query typeahead callback, Bloodhound typeahead adapter
and returns the completions it gets from the bloodhound engine prefixed.
......
......@@ -14,6 +14,23 @@
<label for="Publisher">{{_('Publisher')}}</label>
<input type="text" class="form-control" name="publisher" id="publisher" value="">
</div>
<!--div class="form-group"-->
<div class="row">
<div class="form-group col-sm-6">
<label for="Publishstart">{{_('Publishing date from')}}</label>
<div style="position: relative">
<input type="date" class="form-control" name="Publishstart" id="Publishstart" value="">
<input type="text" class="form-control fake-input hidden" id="fake_Publishstart" value="">
</div>
</div>
<div class="form-group col-sm-6">
<label for="Publishend">{{_('Publishing date to')}}</label>
<div style="position: relative">
<input type="date" class="form-control" name="Publishend" id="Publishend" value="">
<input type="text" class="form-control fake-input hidden" id="fake_Publishend" value="">
</div>
</div>
</div>
<label for="include_tag">{{_('Tags')}}</label>
<div class="form-group" id="test">
<div class="btn-toolbar btn-toolbar-lg" data-toggle="buttons">
......@@ -82,6 +99,14 @@
{% endblock %}
{% block js %}
<script>
var language = '{{ g.user.locale }}';
</script>
<script src="{{ url_for('static', filename='js/libs/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
{% if not g.user.locale == 'en' %}
<script src="{{ url_for('static', filename='js/libs/bootstrap-datepicker/locales/bootstrap-datepicker.' + g.user.locale + '.min.js') }}" charset="UTF-8"></script>
{% endif %}
<script src="{{ url_for('static', filename='js/libs/typeahead.bundle.js') }}"></script>
<script src="{{ url_for('static', filename='js/edit_books.js') }}"></script>
<script>
......@@ -89,4 +114,5 @@
{% endblock %}
{% block header %}
<link href="{{ url_for('static', filename='css/libs/typeahead.css') }}" rel="stylesheet" media="screen">
<link href="{{ url_for('static', filename='css/libs/bootstrap-datepicker3.min.css') }}" rel="stylesheet" media="screen">
{% endblock %}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment