如何从jQuery UI datepicker获取日期 [英] How to get the date from jQuery UI datepicker
本文介绍了如何从jQuery UI datepicker获取日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
每当用户在jQuery UI datepicker中选择日期并点击表单上的按钮时,我想从datepicker获取日期。
I want to get the date from datepicker whenever user choose the date in jQuery UI datepicker and click the button on the form.
我需要得到这一天他们选择的日期,月份和年份。如何从jQuery UI获取日期?
well I need to get the day, month and year of the date they choose. How can I get the date form jQuery UI?
推荐答案
使用
var jsDate = $('#your_datepicker_id').datepicker('getDate');
if (jsDate !== null) { // if any date selected in datepicker
jsDate instanceof Date; // -> true
jsDate.getDate();
jsDate.getMonth();
jsDate.getFullYear();
}
这篇关于如何从jQuery UI datepicker获取日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文