日期范围选择器的本地化
我对 javascript 和 jquery 很陌生。我一直在寻找解决这个问题的方法,但一无所获。我正在使用 http://www.filamentgroup.com/lab/date_range_picker_using_jquery_ui_16_and_jquery_ui_css_framework/。
这是评论中建议的解决方案:
$("input").daterangepicker({
dateFormat:"MM dd yyyy”,
datepickerOptions: $j.extend({},
$j.datepicker.regional[’de’], { //germany
showStatus: true, //this is just a datepicker option
showOn: “both”,//this is just a datepicker option
changeYear :true//this is just a datepicker option
})
});
我尝试了上述方法,但无济于事。我对 javascript 很菜鸟,所以请耐心等待。
parent.$('#start_date_<?php echo $widget_id;?>').daterangepicker({
monthOnly: true,
arrows:false,
dateFormat: 'MM yy',
latestDate: '<?php echo date('Y-m-d');?>',
presetRanges: [
{text:'<?php echo lang('dashboards_month_to_date');?>', dateStart: 'm2d', dateEnd: 'today' },
{text: '<?php echo lang('dashboards_quarter_to_date');?>', dateStart: 'q2d', dateEnd: 'today' },
{text: '<?php echo lang('dashboards_year_to_date');?>', dateStart: 'y2d', dateEnd: 'today' }
],
presets: {
allDatesAfter: '<?php echo lang('dashboards_all_dates_from_first');?>'
},
altFields:'widgetDate_<?php echo $widget_id;?>',
datepickerOptions: {
changeMonth: true,
changeYear: true,
maxDate: Date.today()
},
});
parent.$('#widgetDate_<?php echo $widget_id;?>S').val('<?php echo $options->widgetStartDate;?>');
},10);
{/eval}
假设我需要对法语进行本地化,有人可以给我分步指南来对上述代码进行本地化吗?任何帮助将不胜感激。
I'm very new to javascript and jquery. I've been searching up and down for a solution to this, but I'm getting nowhere. I'm using the daterangepicker from http://www.filamentgroup.com/lab/date_range_picker_using_jquery_ui_16_and_jquery_ui_css_framework/.
This was a suggested solution in the comments:
$("input").daterangepicker({
dateFormat:"MM dd yyyy”,
datepickerOptions: $j.extend({},
$j.datepicker.regional[’de’], { //germany
showStatus: true, //this is just a datepicker option
showOn: “both”,//this is just a datepicker option
changeYear :true//this is just a datepicker option
})
});
I tried the above approach, but go nowhere. I'm quite noob to javascript, so bear with me.
parent.$('#start_date_<?php echo $widget_id;?>').daterangepicker({
monthOnly: true,
arrows:false,
dateFormat: 'MM yy',
latestDate: '<?php echo date('Y-m-d');?>',
presetRanges: [
{text:'<?php echo lang('dashboards_month_to_date');?>', dateStart: 'm2d', dateEnd: 'today' },
{text: '<?php echo lang('dashboards_quarter_to_date');?>', dateStart: 'q2d', dateEnd: 'today' },
{text: '<?php echo lang('dashboards_year_to_date');?>', dateStart: 'y2d', dateEnd: 'today' }
],
presets: {
allDatesAfter: '<?php echo lang('dashboards_all_dates_from_first');?>'
},
altFields:'widgetDate_<?php echo $widget_id;?>',
datepickerOptions: {
changeMonth: true,
changeYear: true,
maxDate: Date.today()
},
});
parent.$('#widgetDate_<?php echo $widget_id;?>S').val('<?php echo $options->widgetStartDate;?>');
},10);
{/eval}
Say I need to do a localization for french, can someone give me step-by-step guide to do this for the above code. Any help will be greatly appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用日期范围选择器选项。
这是意大利语本地化:
You can use the daterangepicker options.
this is the italian localization: