From 62f7674761b6503cfd65040536c4bd986ffdc653 Mon Sep 17 00:00:00 2001 From: OzzieIsaacs Date: Sun, 1 Apr 2018 19:31:41 +0200 Subject: [PATCH] fixed #410 advanced search for publishing date fixed misstyping in italian language removed next to "me" after login --- cps/static/js/edit_books.js | 34 ++++ cps/templates/search_form.html | 26 +++ cps/translations/de/LC_MESSAGES/messages.mo | Bin 304742 -> 305092 bytes cps/translations/de/LC_MESSAGES/messages.po | 173 +++++++++-------- cps/translations/es/LC_MESSAGES/messages.po | 173 +++++++++-------- cps/translations/fr/LC_MESSAGES/messages.po | 173 +++++++++-------- cps/translations/it/LC_MESSAGES/messages.mo | Bin 302809 -> 304962 bytes cps/translations/it/LC_MESSAGES/messages.po | 175 ++++++++++-------- cps/translations/ja/LC_MESSAGES/messages.po | 173 +++++++++-------- cps/translations/nl/LC_MESSAGES/messages.po | 173 +++++++++-------- cps/translations/pl/LC_MESSAGES/messages.po | 173 +++++++++-------- cps/translations/ru/LC_MESSAGES/messages.po | 173 +++++++++-------- .../zh_Hans_CN/LC_MESSAGES/messages.po | 173 +++++++++-------- messages.pot | 173 +++++++++-------- 14 files changed, 1051 insertions(+), 741 deletions(-) diff --git a/cps/static/js/edit_books.js b/cps/static/js/edit_books.js index 96fcc848..dd907c47 100644 --- a/cps/static/js/edit_books.js +++ b/cps/static/js/edit_books.js @@ -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. diff --git a/cps/templates/search_form.html b/cps/templates/search_form.html index d8c3a07d..ad561b19 100644 --- a/cps/templates/search_form.html +++ b/cps/templates/search_form.html @@ -14,6 +14,23 @@ + +
+
+ +
+ + +
+
+
+ +
+ + +
+
+
@@ -82,6 +99,14 @@ {% endblock %} {% block js %} + + + +{% if not g.user.locale == 'en' %} + +{% endif %}