datex.js 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,459 @@
1
+ html{color:#000;background:#FFF}body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,textarea,p,blockquote,th,td{margin:0;padding:0}table{border-collapse:collapse;border-spacing:0}fieldset,img{border:0}address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal}ol,ul{list-style:none}caption,th{text-align:left}h1,h3,h3,h4,h5,h6{font-size:100%;font-weight:normal}q:before,q:after{content:''}abbr,acronym{border:0;font-variant:normal}sup{vertical-align:text-top}sub{vertical-align:text-bottom}input,textarea,select{font-family:inherit;font-size:inherit;font-weight:inherit;*font-size:100%}legend{color:#000}
2
+ html{
3
+ height:100%;
4
+ }
5
+ body{
6
+ height: 100%;
7
+ font-size: 14px;
8
+ font-family: Arial,Helvetica,"Microsoft Yahei";
9
+ color: rgb(110, 119, 129);
10
+ }
11
+ button, input {
12
+ font-family: Arial,Helvetica,"Microsoft Yahei";
13
+ }
14
+ img{
15
+ vertical-align: middle;
16
+ }
17
+ a{
18
+ text-decoration: none;
19
+ color: rgb(110, 119, 129);
20
+ }
21
+ a:hover{
22
+ text-decoration: underline;
23
+ }
24
+
25
+ .wrapper{
26
+ background: url('../image/bg.svg') center top repeat-x;
27
+ }
28
+ .header{
29
+ position: fixed;
30
+ width: 240px;
31
+ height: 100%;
32
+ background: #fafafa;
33
+ border-right: 1px solid rgba(0,0,0,0.045);
34
+ overflow-y: auto;
35
+ }
36
+ .container{
37
+ margin-left: 240px;
38
+ padding-bottom: 30px;
39
+ }
40
+ .inner{
41
+ max-width: 800px;
42
+ padding: 0 10px;
43
+ margin: 0 auto;
44
+ }
45
+ .header::-webkit-scrollbar{
46
+ width: 10px;
47
+ height: 10px;
48
+ background-color: #F5F5F5;
49
+ }
50
+ .header::-webkit-scrollbar-thumb{
51
+ border-radius: 5px;
52
+ -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,.3);
53
+ background-color: #888;
54
+ }
55
+
56
+ .mod-menu{
57
+ height: 100%;
58
+ }
59
+ .mod-menu .bd{
60
+ padding: 25px 0;
61
+ }
62
+ .mod-menu .bd li a{
63
+ display: block;
64
+ position: relative;
65
+ padding: 6px 15px;
66
+ line-height: 18px;
67
+ cursor: pointer;
68
+ text-decoration: none;
69
+ }
70
+ .mod-menu .bd li span{
71
+ display: block;
72
+ }
73
+ .mod-menu .bd span.title{bd
74
+ font-size: 16px;
75
+ font-weight: bold;
76
+ }
77
+ .mod-menu .bd span.subtitle{
78
+ color: #999;
79
+ }
80
+ .mod-menu .bd a.active{
81
+ background: #f5f5f5;
82
+ }
83
+ .mod-menu .bd a.active::before{
84
+ position: absolute;
85
+ left: 2px;
86
+ top: 50%;
87
+ content: '';
88
+ width: 4px;
89
+ height: 32px;
90
+ background: #2095f2;
91
+ margin-top: -16px;
92
+ border-radius: 3px;
93
+ }
94
+ .mod-menu .bd a.active span.title{
95
+ font-weight: bold;
96
+ color: #333;
97
+ }
98
+ .mod-menu .bd a.active span.subtitle{
99
+ font-weight: bold;
100
+ color: #888;
101
+ }
102
+
103
+ .mod-head .bd{
104
+ height: 36px;
105
+ padding: 10px 0;
106
+ text-align: right;
107
+ }
108
+ .mod-head .btn{
109
+ position: relative;
110
+ display: inline-block;
111
+ min-width: 56px;
112
+ height: 34px;
113
+ padding: 0 12px;
114
+ background: rgba(255,255,255,0.3);
115
+ border: 1px solid rgba(0,0,0,0.05);
116
+ border-radius: 6px;
117
+ line-height: 34px;
118
+ text-decoration: none;
119
+ text-align: center;
120
+ font-size: 14px;
121
+ color: #333;
122
+ overflow: hidden;
123
+ transition: color .2s,opacity .2s;
124
+ font-family: Tahoma,Arial, Helvetica,"Microsoft YaHei";
125
+ outline: none;
126
+ -webkit-appearance: none;
127
+ }
128
+ .mod-head .btn:after {
129
+ content: " ";
130
+ position: absolute;
131
+ width: 100%;
132
+ height: 100%;
133
+ background: #000;
134
+ left: 0;
135
+ top: 0;
136
+ opacity: 0;
137
+ transition: opacity .2s;
138
+ border-radius: 6px;
139
+ overflow: hidden;
140
+ pointer-events: none;
141
+ }
142
+ .mod-head .btn span,.mod-head .btn svg{
143
+ vertical-align: middle;
144
+ }
145
+ .mod-head .btn svg,.mod-head .btn svg+span{
146
+ position: relative;
147
+ top: -1px;
148
+ }
149
+ .mod-head .btn:hover {
150
+ color: #000;
151
+ opacity: 1;
152
+ }
153
+ .mod-head .btn:hover:after {
154
+ opacity: .02;
155
+ }
156
+
157
+ .mod-panel{
158
+ margin-bottom: 75px;
159
+ }
160
+ .mod-panel .hd{
161
+ padding: 35px 0;
162
+ line-height: 24px;
163
+ }
164
+ .mod-panel .hd h1{
165
+ margin-bottom: 10px;
166
+ line-height: 48px;
167
+ font-weight: bold;
168
+ font-size: 36px;
169
+ color:#1a2b3b;
170
+ }
171
+ .mod-panel .hd h1 span.tag{
172
+ display: inline-block;
173
+ padding: 0 8px;
174
+ margin: 0 5px;
175
+ background: rgba(255, 255, 255,0.8);
176
+ line-height: 26px;
177
+ vertical-align: middle;
178
+ font-size: 13px;
179
+ color: rgb(110, 119, 129);
180
+ border-radius: 4px;
181
+ box-shadow: 0 1px 5px 0 rgba(0,0,0,0.03);
182
+ }
183
+ .mod-panel .hd p{
184
+ margin-bottom: 10px;
185
+ line-height: 30px;
186
+ font-size: 15px;
187
+ }
188
+ .mod-panel .hd b{
189
+ margin: 0 3px;
190
+ color: #fd7474;
191
+ }
192
+ .mod-panel .bd .box{
193
+ margin-bottom: 20px;
194
+ background: #fff;
195
+ box-shadow: 0 1px 5px 0 rgba(0,0,0,0.05);
196
+ border: 1px solid rgba(0,0,0,0.075);
197
+ }
198
+ .mod-panel .bd .c-hd{
199
+ position: relative;
200
+ padding: 10px 20px;
201
+ border-bottom: 1px solid #f4f4f4;
202
+ }
203
+ .mod-panel .bd .c-hd::before{
204
+ position: absolute;
205
+ left: 2px;
206
+ top: 50%;
207
+ content: '';
208
+ width: 4px;
209
+ height: 36px;
210
+ background: #2095f2;
211
+ margin-top: -18px;
212
+ border-radius: 3px;
213
+ }
214
+ .mod-panel .bd .c-hd p{
215
+ line-height: 18px;
216
+ }
217
+ .mod-panel .bd .c-hd p.title{
218
+ font-size: 16px;
219
+ font-weight: bold;
220
+ }
221
+ .mod-panel .bd .c-hd p.subtitle{
222
+ color: #999;
223
+ }
224
+ .mod-panel .bd .c-hd .more{
225
+ float: right;
226
+ text-decoration: none;
227
+ color: #999;
228
+ }
229
+ .mod-panel .bd .c-bd{
230
+ padding:20px;
231
+ }
232
+ .mod-panel .bd table{
233
+ width: 100%;
234
+ margin: 15px 0;
235
+ }
236
+ .mod-panel .bd caption{
237
+ line-height: 30px;
238
+ font-size: 15px;
239
+ font-weight: bold;
240
+ }
241
+ .mod-panel .bd th,.mod-panel .bd td{
242
+ padding: 6px 12px;
243
+ border: 1px solid #e2e2e2;
244
+ line-height: 22px;
245
+ }
246
+ .mod-panel .bd td.th{
247
+ background: #f5f5f5;
248
+ }
249
+ .mod-panel .bd thead{
250
+ background: #f5f5f5;
251
+ }
252
+ .mod-panel .bd select{
253
+ height: 32px;
254
+ padding: 0 10px;
255
+ border: 1px solid #e2e2e2;
256
+ border-radius: 4px;
257
+ outline: none;
258
+ }
259
+ .mod-panel .bd input[type="text"]{
260
+ width: 240px;
261
+ height: 32px;
262
+ padding: 0 10px;
263
+ border: 1px solid #e2e2e2;
264
+ border-radius: 4px;
265
+ vertical-align: middle;
266
+ outline: none;
267
+ }
268
+ .mod-panel .btn {
269
+ display: inline-block;
270
+ height: 36px;
271
+ min-width: 90px;
272
+ background: #2095f2;
273
+ border: medium none;
274
+ line-height: 36px;
275
+ text-align: center;
276
+ vertical-align: middle;
277
+ font-size: 15px;
278
+ color: #fff;
279
+ cursor: pointer;
280
+ outline: none;
281
+ border-radius: 4px;
282
+ text-decoration: none;
283
+ }
284
+ .mod-panel .btn:hover{
285
+ background: #1b85da;
286
+ }
287
+ .mod-panel .btn-green{
288
+ background: #4bae4f;
289
+ color: #fff;
290
+ }
291
+ .mod-panel .btn-green:hover{
292
+ background: #47a04b;
293
+ }
294
+ .mod-panel .bd .btn-red{
295
+ background: #f56954;
296
+ color: #fff;
297
+ }
298
+ .mod-panel .btn-red:hover{
299
+ background: #f4543c;;
300
+ }
301
+ .mod-panel .btn-orange{
302
+ background: #ff9000;
303
+ color: #fff;
304
+ }
305
+ .mod-panel .btn-orange:hover{
306
+ background: #e18309;
307
+ }
308
+ .mod-panel .btn-small{
309
+ min-width: 36px;
310
+ margin-right: -1px;
311
+ cursor: pointer;
312
+ }
313
+ .mod-panel .btn[disabled]{
314
+ background: #f0f0f0;
315
+ color: #aaa;
316
+ }
317
+ .mod-panel .bd p{
318
+ line-height: 22px;
319
+ word-break: break-word;
320
+ }
321
+ .mod-panel .bd p span{
322
+ margin-right: 4px;
323
+ }
324
+ .mod-panel .bd .text-green{
325
+ color: #4bae4f;
326
+ }
327
+ .mod-panel .bd .text-red{
328
+ color:#f56954;
329
+ }
330
+
331
+ .mod-copy{
332
+ margin-bottom: 65px;
333
+ padding: 35px 0;
334
+ background: rgb(246, 248, 250);
335
+ }
336
+ .mod-copy .hd{
337
+ margin: 0 5px 5px;
338
+ line-height: 30px;
339
+ }
340
+ .mod-copy .hd span{
341
+ font-size: 18px;
342
+ font-weight: bold;
343
+ color: #646464;
344
+ }
345
+ .mod-copy .bd{
346
+ margin:0 5px;
347
+ }
348
+ .mod-copy .bd p{
349
+ line-height: 26px;
350
+ text-indent: 2em;
351
+ font-size: 15px;
352
+ }
353
+ .mod-copy .bd .buttons{
354
+ margin: 15px 0;
355
+ }
356
+ .mod-copy .bd .text-red{
357
+ font-weight: bold;
358
+ color: #fd7474;
359
+ }
360
+ .mod-copy .bd code{
361
+ display: block;
362
+ margin-bottom: 15px;
363
+ padding: 8px 15px;
364
+ line-height: 20px;
365
+ background: #fff;
366
+ border: 1px solid rgba(27,31,36,.15);
367
+ border-radius: 5px;
368
+ word-break: break-word;
369
+ }
370
+
371
+ .mod-foot .bd{
372
+ padding: 10px 0;
373
+ margin-bottom: 15px;
374
+ text-align: center;
375
+ }
376
+ .mod-foot .bd p{
377
+ line-height: 22px;
378
+ }
379
+ .mod-foot .bd p a,.mod-foot .bd p span{
380
+ vertical-align: middle;
381
+ }
382
+ .mod-foot .bd p.buttons{
383
+ margin: 10px 0 5px;
384
+ }
385
+ .mod-foot .box{
386
+ width: 200px;
387
+ height: 180px;
388
+ margin: 0 auto 20px;
389
+ line-height: 30px;
390
+ text-align: center;
391
+ overflow: hidden;
392
+ }
393
+ .mod-foot p{
394
+ line-height: 30px;
395
+ }
396
+
397
+ @media screen and (max-width: 1020px) {
398
+ .header{
399
+ display: none;
400
+ }
401
+ .container{
402
+ margin-left: 0;
403
+ }
404
+ .inner{
405
+ max-width: 640px;
406
+ }
407
+
408
+ .mod-head .hd span.tag{
409
+ padding: 5px 8px;
410
+ }
411
+ .mod-head .bd .btn{
412
+ padding: 0 6px;
413
+ font-size: 13px;
414
+ }
415
+
416
+ .mod-panel{
417
+ margin-bottom: 25px;
418
+ }
419
+ .mod-panel .hd{
420
+ float: none;
421
+ padding-top: 0;
422
+ width: auto;
423
+ margin-bottom: 15px;
424
+ }
425
+ .mod-panel .hd h1{
426
+ margin-bottom: 5px;
427
+ line-height: 26px;
428
+ font-size: 20px;
429
+ }
430
+ .mod-panel .hd p{
431
+ line-height: 22px;
432
+ font-size: 13px;
433
+ overflow: hidden;
434
+ }
435
+
436
+ .mod-copy{
437
+ padding: 15px 0 25px;
438
+ margin-bottom: 25px;
439
+ }
440
+ .mod-copy .bd p{
441
+ line-height: 22px;
442
+ font-size: 14px;
443
+ }
444
+ }
445
+
446
+ @media screen and (max-width: 640px) {
447
+ .mod-panel .inner{
448
+ padding: 10px;
449
+ }
450
+ .mod-panel .bd .c-bd{
451
+ padding: 15px 10px;
452
+ }
453
+ .mod-panel .bd input[type="text"]{
454
+ width: 200px;
455
+ }
456
+ .mod-panel .bd .btn{
457
+ min-width: 64px;
458
+ }
459
+ }
package/test/index.js ADDED
@@ -0,0 +1,15 @@
1
+ 'use strict';
2
+ var test = require('tape');
3
+ var DateX = require('..');
4
+
5
+ test('[Test]', function (t) {
6
+ t.deepEqual(DateX('2008-08-08').getTime(),1218153600000);
7
+ t.deepEqual(DateX(2022,10,1).format('YYYY年MM月DD日'),'2022年10月01日');
8
+ t.deepEqual(DateX(2022,10,1).set('year',2020).format(),'2020-10-01 00:00:00');
9
+ t.deepEqual(DateX(2022,10,1).change('year',1).format(),'2023-10-01 00:00:00');
10
+ t.deepEqual(DateX(2022,10,10).startOf('month').format(),'2022-10-01 00:00:00');
11
+ t.deepEqual(DateX(2022,10,10).endOf('month').format(),'2022-10-31 23:59:59');
12
+ t.deepEqual(DateX(2008,8,8,23,45,45).get('hour'),23);
13
+ t.deepEqual(DateX('1949-10-01').diffWith('2022-12-01','month'),-878);
14
+ t.end();
15
+ });