Toggle navigation
Toggle navigation
This project
Loading...
Sign in
teamPARK
/
holiday-counter-recommend-activity
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
박종현
2022-05-13 16:31:44 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
962f15a395fbf78affba5bb6675906e6c843124e
962f15a3
1 parent
a0b469c6
Update feature/holiday-counter into server.js
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
server.js
server.js
View file @
962f15a
...
...
@@ -74,6 +74,19 @@ function init() {
locdate
.
push
(
tempStr
);
idx
=
text
.
indexOf
(
"locdate"
,
idx
+
1
);
}
let
i
=
0
;
let
length
=
dateName
.
length
;
while
(
i
<
length
){
var
temptoday
=
dateName
[
i
];
var
tempdate
=
locdate
[
i
];
var
modifiedDate
=
tempdate
.
substr
(
0
,
4
)
+
'-'
+
tempdate
.
substr
(
4
,
2
)
+
'-'
+
tempdate
.
substr
(
6
,
2
);
var
today
=
new
Date
(
"2022-05-13"
);
//오늘 날짜 입력
var
holiday
=
new
Date
(
modifiedDate
);
//공휴일 날짜 입력
var
diffDate
=
today
.
getTime
()
-
holiday
.
getTime
();
var
dday
=
Math
.
abs
(
diffDate
/
(
1000
*
3600
*
24
));
console
.
log
(
temptoday
+
"까지 "
+
dday
+
"일 남았습니다."
);
i
++
;
}
console
.
log
(
locdate
);
// Create tempArr to save dateName and locdate at once
tempArr
=
[];
...
...
@@ -86,6 +99,8 @@ function init() {
});
}
app
.
get
(
"/"
,
function
(
req
,
res
)
{
init
();
// Send data from nodejs to ejs
...
...
Please
register
or
login
to post a comment