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

查看:12
本文介绍了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天全站免登陆