My97DatePicker是什么?

PHPz
Release: 2020-09-04 17:47:47
Original
2704 people have browsed it

My97DatePicker是一款优秀的日期插件,该插件可以很方便地实现各种日期选择效果,其使用语法如“class="Wdate" onFocus="WdatePicker({lang:'zh-cn'})"”。

My97DatePicker是什么?

My97DatePicker是一款优秀的日期插件,它可以很方便地实现各种日期选择效果,博得广大IT开发人员的青睐。

1.png

1.先来最简单的配置方法:

(1)下载WdatePicker.js(包括lang和skin文件夹)。

(2)在html页面中导入WdatePicker.js。

(3)在输入框input元素上加入class="Wdate" onFocus="WdatePicker({lang:'zh-cn'})"代码。

(4)打开页面查看效果。

2.png

2.只读,添加控制:开始日期要小于当前日期或小于截止日期;截止日期要大于开始日期小于当前日期

<div>
     起始日期:
        <input type="text" class="Wdate" id="startTime" 
	onClick="WdatePicker({autoPickDate:true,dateFmt:&#39;yyyy-MM-dd&#39;,maxDate:&#39;#F{$dp.$D(\&#39;endTime\&#39;)||\&#39;new Date()\&#39;}&#39;,readOnly:true})" style="width: 120px;"/>
     截止日期:
	<input type="text" class="Wdate" id="endTime" 
	onClick="WdatePicker({autoPickDate:true,dateFmt:&#39;yyyy-MM-dd&#39;,minDate:&#39;#F{$dp.$D(\&#39;startTime\&#39;)}&#39;,maxDate:new Date(),readOnly:true})" style="width: 120px;"/>
</div>
Copy after login

效果图:

3.png

4.png

3.获取输入框中的时间:

js中:

var startTime = $("#startTime").val();即可

更多相关知识,请访问 PHP中文网!!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!