Skip to content

Commit

Permalink
Localized calendars
Browse files Browse the repository at this point in the history
  • Loading branch information
mpasternak committed Oct 23, 2014
1 parent 136532d commit 2a89686
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 4 deletions.
4 changes: 2 additions & 2 deletions multiseek/static/multiseek/js/multiseek.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,8 @@ $.widget("multiseek.multiseekDateValue", $.multiseek.multiseekBaseValue, {
if (element.fdatepicker)
/* Use Foundation 4 date picker if available */
element.fdatepicker({
format: 'dd.mm.yyyy',
weekStart: 1,
format: multiseekDateFormat,
weekStart: multiseekDateWeekStart,
language: djangoLanguageCode
});
else
Expand Down
6 changes: 6 additions & 0 deletions multiseek/templates/multiseek/multiseek_head.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,11 @@
<script>
/* multiseek.js needs that to be set before */
djangoLanguageCode = '{{ LANGUAGE_CODE }}';

// currently hard-coded, but could be parametrized in the future, those
// settings are used for Foundation datepicker, to enforce date format.
multiseekDateFormat = 'yyyy-mm-dd';
multiseekDateWeekStart = 1;

</script>
<script src="{{ STATIC_URL }}multiseek/js/multiseek.js" type="text/javascript"></script>
4 changes: 4 additions & 0 deletions test_project/test_app/templates/multiseek/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
<script src="{% static 'jqueryui/jquery-ui.min.js' %}" type="text/javascript"></script>
<script src="{% static 'datetimepicker/jquery.datetimepicker.js' %}"></script>

{# I'm unsure how to parametryze this for LANGUAGE_CODE with default #}
{# Django templating engine, in Jinja2 I'd use {% set ... %} #}
<script src="{% static 'jquery.ui.datepicker-pl/index.js' %}"></script>

{% if request.GET.foundation == "1" %}
<script src="{% static 'foundation/js/vendor/modernizr.js' %}"></script>
<script src="{% static 'foundation/js/vendor/fastclick.js' %}"></script>
Expand Down
7 changes: 5 additions & 2 deletions test_project/test_project/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,11 @@
'foundation-datepicker',
'font-awesome',

# For nice calendar
'https://raw.githubusercontent.com/taitems/Aristo-jQuery-UI-Theme/master/css/Aristo/Aristo.css'
# For nice jQuery calendar
'https://raw.githubusercontent.com/taitems/Aristo-jQuery-UI-Theme/master/css/Aristo/Aristo.css',

# for translated jQuery calendar
'https://jquery-ui.googlecode.com/svn-history/r3243/trunk/ui/i18n/jquery.ui.datepicker-pl.js'
)

BOWER_COMPONENTS_ROOT = os.path.join(os.path.dirname(__file__), '..', 'components')

0 comments on commit 2a89686

Please sign in to comment.