您的位置:首页 > Web前端 > JQuery

jquery ui datepicker时间格式

2015-01-26 16:47 447 查看
下载jquery ui 的版本不同该功能的时间格式也不同;

修改英文格式找到如下类似代码进行修改:修改它的构造函数;

function Datepicker()
{
this._curInst = null; // The current instance in use

 this._keyEvent = false; // If the last event was a key event

this._disabledInputs = []; // List of date picker inputs that have been disabled

 this._datepickerShowing = false; // True if the popup picker is showing , false if not

 this._inDialog = false; // True if showing within a "dialog", false if not

 this._mainDivId = "ui-datepicker-div"; // The ID of the main datepicker division

 this._inlineClass = "ui-datepicker-inline"; // The name of the inline marker class

 this._appendClass = "ui-datepicker-append"; // The name of the append marker class

 this._triggerClass = "ui-datepicker-trigger"; // The name of the trigger marker class

 this._dialogClass = "ui-datepicker-dialog"; // The name of the dialog marker class

 this._disableClass = "ui-datepicker-disabled"; // The name of the disabled covering marker class

 this._unselectableClass = "ui-datepicker-unselectable"; // The name of the unselectable cell marker class

 this._currentClass = "ui-datepicker-current-day"; // The name of the current day marker class

 this._dayOverClass = "ui-datepicker-days-cell-over"; // The name of the day hover marker class

 this.regional = []; // Available regional settings, indexed by language code

 this.regional[""] =
{
closeText: "Done",

prevText: "Prev",

nextText: "Next",

currentText: "Today",

monthNames: ["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],

monthNamesShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],

dayNames: ["日", "一", "二", "三", "四", "五", "六"],

dayNamesShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],

 dayNamesMin: ["日","一","二","三","四","五","六"],

weekHeader: "Wk",

                dateFormat: "mm/dd/yy",

firstDay: 0,

isRTL: false,

showMonthAfterYear: false,

yearSuffix: ""
};
2)将时间格式转换为自己想要的:

举例:

$("#xxx").datepicker({dateFormat:'yy-mm-dd'});

或者直接修改上面dateFormat位置;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  jquery ui