Javascript 如何在mvc中更改日期格式dd/mm/yyyy?

Javascript 如何在mvc中更改日期格式dd/mm/yyyy?,javascript,c#,jquery,asp.net-mvc,model-view-controller,Javascript,C#,Jquery,Asp.net Mvc,Model View Controller,我有以下格式mm/dd/yyyy如何将其更改为dd/mm/yyyy $(function () { $('#txtDocDOB').daterangepicker({ singleDatePicker: true, showDropdowns: true, }); }); 输入类型: <div class='input-group date'>

我有以下格式
mm/dd/yyyy
如何将其更改为
dd/mm/yyyy

$(function () {
            $('#txtDocDOB').daterangepicker({
                singleDatePicker: true,
                showDropdowns: true,
            });
});
输入类型:

<div class='input-group date'>
                                                    <input id="txtDocDOB" type="text" value="10/24/1984" class="form-control">
                                                    <span class="input-group-addon">
                                                        <i class="font-icon font-icon-calend"></i>
                                                    </span>
                                                </div>

/**
*@version:2.1.19
*@作者:丹·格罗斯曼http://www.dangrossman.info/
*@版权所有:版权所有(c)2012-2015丹·格罗斯曼。版权所有。
*@license:根据麻省理工学院许可证获得许可。看见http://www.opensource.org/licenses/mit-license.php
*@网站:https://www.improvely.com/
*/
(函数(根,工厂){
var DateRangePicker=函数(元素、选项、cb){
//选项的默认设置
this.parentEl='body';
this.element=$(element);
this.startDate=力矩().startOf('day');
this.endDate=moment().endOf('day');
this.minDate=false;
this.maxDate=false;
this.dateLimit=false;
this.autoApply=false;
this.singleDatePicker=false;
this.showDropdowns=false;
this.showWeekNumbers=false;
this.showisoWeekNumber=false;
this.timePicker=false;
this.timePicker24Hour=false;
this.timePickerIncrement=1;
this.timePickerSeconds=false;
this.linkedCalendars=true;
this.autoUpdateInput=true;
this.alwaysShowCalendars=false;
this.ranges={};
this.opens='右';
if(this.element.hasClass('pull-right'))
this.opens='左';
this.drops='down';
if(this.element.hasClass('dropup'))
this.drops='up';
this.buttonClasses='btn btn sm';
this.applyClass='btn success';
this.cancelClass='btn default';
this.locale={
格式:“MM/DD/YYYY”,
分隔符:'-',
applyLabel:“应用”,
取消标签:“取消”,
weekLabel:“W”,
customRangeLabel:“自定义范围”,
daysOfWeek:moment.weekdaysMin(),
monthNames:moment.MonthShort(),
firstDay:moment.localeData().firstDayOfWeek()
};
this.callback=函数(){};
//一些国家信息
this.isShowing=false;
this.leftCalendar={};
this.rightCalendar={};
//来自用户的自定义选项
如果(选项类型!='object'| |选项===null)
选项={};
//允许使用数据属性设置选项
//数据api选项将被自定义javascript选项覆盖
options=$.extend(this.element.data(),options);
//选择器UI的html模板
if(typeof options.template!='string'&&&!(options.template instanceof$)
options.template=''+
'' +
'' +
'' +
'' +
'' +
'' +
'' +
'' +
'' +
'' +
'' +
'' +
'' +
'' +
'' +
'' +
'' +
'' +
'' +
'' +
'' +
'' +
'' +
'' +
' ' +
'' +
'' +
'' +
'';
//
//处理覆盖默认值的所有可能选项
//
if(typeof options.singleDatePicker=='boolean'){
this.singleDatePicker=options.singleDatePicker;
if(此.singleDatePicker)
this.endDate=this.startDate.clone();
}
if(此.singleDatePicker){
this.container.addClass('single');
this.container.find('.calendar.left').addClass('single');
this.container.find('.calendar.left').show();
this.container.find('.calendar.right').hide();
this.container.find('.daterangepicker_输入,.daterangepicker_输入i').hide();
如果(!this.timePicker){
this.container.find('.ranges').hide();
}
}
if((typeof options.ranges=='undefined'&&!this.singleDatePicker)| | this.alwaysShowCalendars){
this.container.addClass('show-calendar');
}
this.container.addClass('opens'+this.opens);
//如果右侧打开,则交换预定义范围的位置
if(typeof options.ranges!='undefined'&&this.opens=='right'){
var ranges=this.container.find('.ranges');
var html=ranges.clone();
ranges.remove();
this.container.find('.calendar.left').parent().prepend(html);
}
//将CSS类和标签应用于按钮
this.container.find('.applyBtn.cancelBtn').addClass(this.buttonClasses);
if(此applyClass.length)
this.container.find('.applyBtn').addClass(this.applyClass);
if(this.cancelClass.length)
this.container.find('.cancelBtn').addClass(this.cancelClass);
this.container.find('.applyBtn').html(this.locale.applyLabel);
this.container.find('.cancelBtn').html(this.locale.cancelabel);
//
//事件侦听器
//
此.container.find(“.calendar”)
.on('click.daterangepicker'、'.prev'、$.proxy(this.clickPrev,this))
.on('click.daterangepicker'、'.next'、$.proxy(this.clickNext,this))
.on('click.daterangepicker','td.available',$.proxy(this.clickDate,this))
在…上
$('#txtDocDOB').daterangepicker({
   locale: {
      format: 'DD-MM-YYYY'
   },
   singleDatePicker: true,
   showDropdowns: true,
});