Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/385.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript JQuery日期选择器不返回mm/dd/yy_Javascript_Jquery_Jquery Ui_Jquery Ui Datepicker - Fatal编程技术网

Javascript JQuery日期选择器不返回mm/dd/yy

Javascript JQuery日期选择器不返回mm/dd/yy,javascript,jquery,jquery-ui,jquery-ui-datepicker,Javascript,Jquery,Jquery Ui,Jquery Ui Datepicker,我正在尝试使用JQuery datepicker将日期转换为dd/mm/yy格式。但我最终得到了dd/mm/yyyy。下面是我试过的代码- chkIn = $.datepicker.formatDate("dd/mm/yy", cinDate); where cinDate is Thu Aug 29 2013 00:00:00 GMT+0530 chkIn是2013年8月29日 y年两位数 yy年四位数 所以使用chkIn=$.datepicker.formatDatedd/mm/y,cin

我正在尝试使用JQuery datepicker将日期转换为dd/mm/yy格式。但我最终得到了dd/mm/yyyy。下面是我试过的代码-

chkIn = $.datepicker.formatDate("dd/mm/yy", cinDate); where cinDate is Thu Aug 29 2013 00:00:00 GMT+0530
chkIn是2013年8月29日

y年两位数

yy年四位数

所以使用chkIn=$.datepicker.formatDatedd/mm/y,cinDate

y年两位数

yy年四位数

所以使用chkIn=$.datepicker.formatDatedd/mm/y,cinDate

试试这个

$( "#datepicker" ).datepicker( "option", "mm/dd/y", cinDate );
试试这个

$( "#datepicker" ).datepicker( "option", "mm/dd/y", cinDate );
您必须使用dd/mm/y而不是dd/mm/yy

$.datepicker.formatDate格式、日期、设置

将日期格式化为具有指定格式的字符串值

The format can be combinations of the following:

d - day of month (no leading zero)
dd - day of month (two digit)
o - day of the year (no leading zeros)
oo - day of the year (three digit)
D - day name short
DD - day name long
m - month of year (no leading zero)
mm - month of year (two digit)
M - month name short
MM - month name long
y - year (two digit)
yy - year (four digit)
@ - Unix timestamp (ms since 01/01/1970)
! - Windows ticks (100ns since 01/01/0001)
'...' - literal text
'' - single quote
anything else - literal text
您必须使用dd/mm/y而不是dd/mm/yy

$.datepicker.formatDate格式、日期、设置

将日期格式化为具有指定格式的字符串值

The format can be combinations of the following:

d - day of month (no leading zero)
dd - day of month (two digit)
o - day of the year (no leading zeros)
oo - day of the year (three digit)
D - day name short
DD - day name long
m - month of year (no leading zero)
mm - month of year (two digit)
M - month name short
MM - month name long
y - year (two digit)
yy - year (four digit)
@ - Unix timestamp (ms since 01/01/1970)
! - Windows ticks (100ns since 01/01/0001)
'...' - literal text
'' - single quote
anything else - literal text

我认为,您的代码必须工作:

var cinDate = new Date(); // it must be a date object
var current_date = $.datepicker.formatDate('dd/mm/yy', cinDate);
它对我有用


看看这个:

我认为,您的代码必须能够工作:

var cinDate = new Date(); // it must be a date object
var current_date = $.datepicker.formatDate('dd/mm/yy', cinDate);
它对我有用

看看这个: