jQuery Datepicker本地化德语 [英] JQuery Datepicker Localization German

查看:88
本文介绍了jQuery Datepicker本地化德语的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先,我想说明一下,我已经阅读了很多有关该主题的主题,但是都没有解决我的问题.

First off, I want to state, that I've read a lot of threads on this Topic but none solved my Problem.

所以我需要德语JQuery Datepicker.因此,我在Datepicker中设置了区域属性:

So I need a german JQuery Datepicker. So I set the regional attribute in the Datepicker:

<script>
    $(function() {
        $("#datepicker").datepicker({
            numberOfMonths : 3,
            showButtonPanel : true,
            altField : "#datepicker_input",
            dateFormat : "dd-mm-yy"
        }, $.datepicker.regional['de']);
    });
</script>

但这似乎不起作用.我还寻找了德国人JQuery UI,但没有找到任何东西.

But this doesn't seem to work. I also looked for a german JQuery UI but didn't find anything.

能给我一个起点吗?

推荐答案

检查是否已包含德语的本地化js文件

Check whether you have included the localization js file for the german

如果您不是要包括此内容

if you not means include this

<script type="text/javascript"
        src="http://jquery-ui.googlecode.com/svn/tags/latest/ui/minified/i18n/jquery-ui-i18n.min.js">
</script>

并且代码应为

 $(function() {
  $('#datepicker').datepicker({
       prevText: '&#x3c;zurück', prevStatus: '',
        prevJumpText: '&#x3c;&#x3c;', prevJumpStatus: '',
        nextText: 'Vor&#x3e;', nextStatus: '',
        nextJumpText: '&#x3e;&#x3e;', nextJumpStatus: '',
        currentText: 'heute', currentStatus: '',
        todayText: 'heute', todayStatus: '',
        clearText: '-', clearStatus: '',
        closeText: 'schließen', closeStatus: '',
        monthNames: ['Januar','Februar','März','April','Mai','Juni',
        'Juli','August','September','Oktober','November','Dezember'],
        monthNamesShort: ['Jan','Feb','Mär','Apr','Mai','Jun',
        'Jul','Aug','Sep','Okt','Nov','Dez'],
        dayNames: ['Sonntag','Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag'],
        dayNamesShort: ['So','Mo','Di','Mi','Do','Fr','Sa'],
        dayNamesMin: ['So','Mo','Di','Mi','Do','Fr','Sa'],
      showMonthAfterYear: false,
      showOn: 'both',
      buttonImage: 'media/img/calendar.png',
      buttonImageOnly: true,
      dateFormat:'d MM, y'
    } 
  );

});

演示

这篇关于jQuery Datepicker本地化德语的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆