Skip to content
This repository has been archived by the owner. It is now read-only.

Commit cd88208

Browse files
committed
写了gulpfile和添加了demo.html
1 parent 2709535 commit cd88208

7 files changed

+93
-9
lines changed

demo.html

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>ejDate-Demo</title>
6+
<link rel="stylesheet" href="dist/jquery.ejDate.min.css">
7+
<script src="https://cdn.bootcss.com/jquery/3.1.1/jquery.min.js"></script>
8+
<script src="dist/jquery.ejDate.min.js"></script>
9+
<style>
10+
* {
11+
margin: 0;
12+
padding: 0;
13+
}
14+
15+
body {
16+
font-family: "Microsoft YaHei",Arial,Helvetica,sans-serif;
17+
}
18+
19+
.wrap {
20+
width: 500px;
21+
margin: 20px auto;
22+
text-align: center;
23+
}
24+
25+
input[type="text"] {
26+
display: block;
27+
width: 100%;
28+
height: 20px;
29+
padding: 6px 12px;
30+
font-size: 14px;
31+
line-height: 1.42857143;
32+
color: #555;
33+
background-color: #fff;
34+
background-image: none;
35+
border: 1px solid #ccc;
36+
border-radius: 4px;
37+
-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
38+
box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
39+
-webkit-transition: border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;
40+
-o-transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;
41+
transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;
42+
}
43+
</style>
44+
</head>
45+
<body>
46+
<div class="wrap">
47+
<div class="ejdate-wrap" id="demo_ejdate">
48+
<input type="text">
49+
</div>
50+
</div>
51+
<script>
52+
$('#demo_ejdate').ejDate({
53+
yearULV:2020, // 设置年份的上限值
54+
yearDLV:1970, // 设置年份的下限值
55+
disabledDateReg:/2016y10m((11d)|(15d))/, //筛选不可选日期的正则
56+
checkedDateFunc:function(date){ // 选中日期后执行的回调函数
57+
console.log(date);
58+
}
59+
});
60+
</script>
61+
</body>
62+
</html>

dist/jquery.ejDate.min.css

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/jquery.ejDate.min.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gulpfile.js

+14-2
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,28 @@
11
var gulp = require('gulp'),
22
uglify = require('gulp-uglify'),
3-
csso = require('gulp-csso');
3+
rename = require('gulp-rename'),
4+
autoprefixer = require('gulp-autoprefixer'),
5+
minifyCss = require('gulp-clean-css');
46

57
gulp.task('js',function(){
68
gulp.src('jquery.ejDate.js')
79
.pipe(uglify())
10+
.pipe(rename({suffix: '.min'}))
811
.pipe(gulp.dest('dist'));
912
});
1013

1114
gulp.task('css',function(){
1215
gulp.src('jquery.ejDate.css')
13-
.pipe(csso())
16+
.pipe(autoprefixer({
17+
browsers: ['last 20 versions'],
18+
cascade: true
19+
}))
20+
.pipe(minifyCss({
21+
compatibility: 'ie8',
22+
advanced: false,
23+
keepSpecialComments: '*'
24+
}))
25+
.pipe(rename({suffix: '.min'}))
1426
.pipe(gulp.dest('dist'));
1527
});
1628

jquery.ejDate.css

+2-1
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,11 @@
118118

119119
.ejdate-main select {
120120
display: inline-block;
121-
width: 65px;
121+
width: 70px;
122122
height: 30px;
123123
border: 1px solid #c4c4c4;
124124
border-radius: 5px;
125+
font-size: 16px;
125126
vertical-align:middle;
126127
outline: none;
127128
cursor: pointer;

package.json

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "date-component",
2+
"name": "ejDate.js",
33
"version": "1.0.0",
44
"description": "",
55
"main": "index.js",
@@ -8,17 +8,18 @@
88
},
99
"repository": {
1010
"type": "git",
11-
"url": "git+https://github.com/stackjie/date-component.git"
11+
"url": "git+https://github.com/stackjie/ejDate.js.git"
1212
},
1313
"author": "",
1414
"license": "ISC",
1515
"bugs": {
16-
"url": "https://github.com/stackjie/date-component/issues"
16+
"url": "https://github.com/stackjie/ejDate.js/issues"
1717
},
18-
"homepage": "https://github.com/stackjie/date-component#readme",
18+
"homepage": "https://github.com/stackjie/ejDate.js#readme",
1919
"devDependencies": {
2020
"gulp": "^3.9.1",
21-
"gulp-csso": "^2.0.0",
21+
"gulp-autoprefixer": "^3.1.1",
22+
"gulp-clean-css": "^2.0.13",
2223
"gulp-rename": "^1.2.2",
2324
"gulp-uglify": "^2.0.0"
2425
},

test/test2.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
<meta charset="UTF-8">
55
<title>Document</title>
6-
<link rel="stylesheet" href="../jquery.ejDate.css">
6+
<link rel="stylesheet" href="../dist/jquery.ejDate.min.css">
77
<style>
88
* {
99
margin: 0;

0 commit comments

Comments
 (0)