Hello,
I'm configuring a multilingual (English and Norwegian) with a view with an exposed Content: Post date filter, using Ajax and Better Exposed Filters.
When the site is in English, everything works great: You click the date field, the date-picker pops up; you click a date, the correct date is returned in the m/d/Y format, and the filter returns the expected results.
However, when you try to do this in Norwegian, clicking a date on the date-picker returns values in the d/m/y (strangely, not Y) format for d and m, but norwegian template letters for y , e.g. "02/01/åå", where "åå" stands for "yy" (year, year). The view then updates, but ignores the date as a filter completely.
This leads me to think there's something going wrong when date-popup is trying to retrieve the a specific norwegian format described somewhere. I have tried changing the localized date types for Norwegian to the default english format, but still no go.
I've attached some images that display my settings and results.
I set the issue priority to major because the issue has "significant repercussions" for my setup, "but [does] not render the whole system unusable". I hope that's OK.
Major kudos to anyone who have any idea of where the problem originates! Thank you.
Comment | File | Size | Author |
---|---|---|---|
#7 | Autosubmit ignores script after first run.png | 8.15 KB | Larsac07 |
Norwegian datetime localized settings.png | 22.08 KB | Larsac07 | |
English datetime localized settings.png | 19.02 KB | Larsac07 |
Comments
Comment #1
Larsac07 CreditAttribution: Larsac07 commentedComment #2
Larsac07 CreditAttribution: Larsac07 commentedComment #3
vijaycs85hmm, looks like more of jQueryUI issue which doesn't get the language part. Can you check,if you have included jquery.ui.datepicker-[langcode].js in your page?
Comment #4
vijaycs85and making this issue as normal as per https://drupal.org/node/45111
Comment #5
Larsac07 CreditAttribution: Larsac07 commented@vijaycs85 No, it looks like there's no jquery.ui.datepicker-no (Norwegian) running (see attached image).
How do you add this? I think I found the file to download here: http://jquery-ui.googlecode.com/svn/tags/latest/ui/i18n/jquery.ui.datepicker-no.js. Simply upload to misc/ui/, where the jquery.ui.datepicker.min.js?v=1.8.7 is located?
Btw, thanks for the quick response and fixing the priority level.
Comment #6
vijaycs85You may need to do this: http://stackoverflow.com/questions/1452681/jquery-datepicker-localization if it works, please comeback and close this issue. Changing status from 'bug report' to 'support request' as it doesn't look like module or code issue.
Comment #7
Larsac07 CreditAttribution: Larsac07 commentedWell, that did work somewhat.
I added
drupal_add_js(drupal_get_path('theme', 'spuib_by_skarr') .'/jquery.ui.datepicker-no.js');
to my template.php,scripts[] = jquery.ui.datepicker-no.js
to my spuib_by_skarr.info and of course I added the jquery.ui.datepicker-no.js file to my theme directory.The first time I select a date (e.g. in my "From date" filter, the input is correct, and I get the expected results, but if I then either select a new date in my "From date" filter or select a new date in my "To date" filter, the format is again output as e.g. "02/25/åå". It seems that auto submit ignores the script after first runthrough. See new attached image.
Comment #8
vijaycs85Did you clear cache after changes? and make sure there is no js aggregation.
Comment #9
Larsac07 CreditAttribution: Larsac07 commentedYup, cleared cache and made shure Aggregate javascript was turned off. Still the same.
Could the problem perhaps be the way I included the .js? Could there be some kind of parameter I didn't set to make shure it stays persistent after an ajax-query? I'm thinking of the
drupal_add_js(drupal_get_path('theme', 'spuib_by_skarr') .'/jquery.ui.datepicker-no.js');
Comment #10
Larsac07 CreditAttribution: Larsac07 commentedPerhaps it should be inline with the view and not in
<head>
?Comment #11
marcofernandes CreditAttribution: marcofernandes at Frontkom commentedJust in case someone arrives here through a search engine looking for an answer:
This is a translation issue. The norwegian translation has an entry for "mm/dd/yy" -> "mm/dd/åå". The date format shouldn't be translated.
Quick workaround: just fix the translation.
Comment #12
marcofernandes CreditAttribution: marcofernandes at Frontkom commented