Skip to content

Commit dc9c5fd

Browse files
author
liguanliang
committed
File catalogue
1 parent b114c0e commit dc9c5fd

18 files changed

+27
-77
lines changed

js/quickSort.js Array/quickSort.js

File renamed without changes.

js/sortN.js Array/sortN.js

File renamed without changes.

js/index.js ES6/index.js

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

index.html

+1-50
Original file line numberDiff line numberDiff line change
@@ -70,53 +70,4 @@
7070

7171
</html>
7272
<script src="js/jquery.js"></script>
73-
74-
<!--<script src="js/timeCounter.js"></script>-->
75-
76-
<!-- <script src="js/index.js"></script> -->
77-
78-
<!--<script src="js/30-seconds-of-code.js"></script>-->
79-
80-
<!--<script src="js/indexedDB.js"></script>-->
81-
82-
<!-- 排序算法 -->
83-
<!--<script src="js/quickSort.js"></script>-->
84-
85-
<!-- 多维数组转为一维数组 -->
86-
<!-- <script src="js/multidimensional_array_to_one-dimensional_array.js"></script> -->
87-
88-
<!-- blob 保存为文件 -->
89-
<!--<script src="js/BlobSaveAsFile.js"></script>-->
90-
91-
<!-- 运算符理解 -->
92-
<!-- <script src='./js/operational_character.js'></script> -->
93-
94-
<!-- 图片队列加载 -->
95-
<!-- <script src="./queueImageLoad/queeuImageLoad.js"></script> -->
96-
97-
<!-- N个数字 ,两个数字之和大于某个数字 的组合 -->
98-
<!-- <script src="./js/sortN.js"></script> -->
99-
100-
<!-- object -->
101-
<!-- <script src="./object/object.js"></script> -->
102-
103-
<!-- worker -->
104-
<!-- <script src="./algorithm/twoSum.js"></script> -->
105-
<!-- 之后的代码需要起一个http server (npm i http-server) -->
106-
<!-- worker -->
107-
<!-- <script src="./worker/index.js"></script> -->
108-
109-
<!-- Object.defineproperty 实现造一个数组 -->
110-
<!-- <script src="./object/Object_defineproperty.js"></script>. -->
111-
112-
<!-- Array -->
113-
<script type="module" src="./Array/index.js"></script>
114-
115-
<!-- RegExp -->
116-
<!-- <script type="module" src="./Reg/index.js"></script> -->
117-
118-
<!-- method overloading -->
119-
<!-- <script type="module" src="./js/methodOverloading.js"></script> -->
120-
121-
<!-- module pattern -->
122-
<!-- <script type="module" src="./js/modulePattern.js"></script> -->
73+
<script type="module" src="ES6/index.js"></script>

js/les_miserables.txt

-1
This file was deleted.

js/timeCounter.js

-26
This file was deleted.
File renamed without changes.
File renamed without changes.

utils/timeCounterToEndTime.js

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
2+
export function timeCount(EndTime) {
3+
let nowTime = new Date();
4+
let yearTime = new Date(EndTime).setHours(0);
5+
//毫秒
6+
let mileSecond = parseInt((yearTime - nowTime) % 1000 / 100);
7+
let mileSecondStrArr = ((mileSecond) / 10).toString().split('.');
8+
let mileSecondStr = mileSecondStrArr[1] ? '.' + mileSecondStrArr[1] : '.0';
9+
//秒
10+
let second = Math.floor((yearTime - nowTime) / 1000);
11+
let secondStr = (second % 60) > 0 ? (second % 60) + mileSecondStr + '秒' : '0秒';
12+
//分
13+
let min = Math.floor(second / 60);
14+
let minStr = (min % 60) > 0 ? (min % 60) + '分' : '';
15+
//时
16+
let hour = Math.floor(min / 60);
17+
let hourStr = (hour % 24) > 0 ? (hour % 24) + '时' : '';
18+
//天
19+
let day = Math.floor(hour / 24);
20+
let dayStr = day > 0 ? day + '天' : '';
21+
return `${dayStr}${hourStr}${minStr}${secondStr}`
22+
}
23+
24+
var EndTime = '2019-12-31'
25+
26+
setInterval(() => timeCount(EndTime), 100);

0 commit comments

Comments
 (0)