jQuery datepicker()-默认为yyyy/mm/dd [英] jQuery datepicker() - defaulting to yyyy/mm/dd

查看:79
本文介绍了jQuery datepicker()-默认为yyyy/mm/dd的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在日期选择器上选择一个日期时,我需要它 默认为yyyy/mm/dd

When I select a date on the datepicker, I need it to default to yyyy/mm/dd

当我执行以下操作时:

     $(id).datepicker("option", "dateFormat", 'yyyy/mm/dd');

并选择一个字段,日期选择器甚至不会出现.

and select a field, the datepicker does not even come up.

我上面的东西有什么问题吗?

Is there anything wrong with what I have above?

很明显

     $(id).datepicker(); 

工作,但它不像我喜欢的那样形成日期"yyyy/mm/dd

work but it does not form that date the way I like it " yyyy/mm/dd

推荐答案

使用格式设置:

$("#your_ID").datepicker({dateFormat: "yyyy/mm/dd"});

要获取日期值,请使用此:

For getting value of date use this:

var date = $("#your_ID").datepicker({ dateFormat: 'yyyy/mm/dd' }).val();

这篇关于jQuery datepicker()-默认为yyyy/mm/dd的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆