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-20 00:24:01 +0900
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
2e9c463a76789bf8bd7af5b8d60f79e7899e44b5
2e9c463a
2 parents
8336ccb4
962f15a3
Merge branch 'feature/holiday-counter'
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
0 deletions
feature-holiday-counter/.vscode/launch.json
feature-holiday-counter/app.js
server.js
feature-holiday-counter/.vscode/launch.json
0 → 100644
View file @
2e9c463
{
//
IntelliSense를
사용하여
가능한
특성에
대해
알아보세요.
//
기존
특성에
대한
설명을
보려면
가리킵니다.
//
자세한
내용을
보려면
https
:
//go.microsoft.com/fwlink/?linkid=
830387
을(를)
방문하세요.
"version"
:
"0.2.0"
,
"configurations"
:
[
{
"type"
:
"pwa-node"
,
"request"
:
"launch"
,
"name"
:
"Launch Program"
,
"skipFiles"
:
[
"<node_internals>/**"
],
"program"
:
"${workspaceFolder}
\\
app.js"
}
]
}
\ No newline at end of file
feature-holiday-counter/app.js
0 → 100644
View file @
2e9c463
const
today
=
new
Date
(
"2022-05-12"
);
//오늘 날짜 입력
const
holiday
=
new
Date
(
"2022-10-01"
);
//공휴일 날짜 입력
const
diffDate
=
today
.
getTime
()
-
holiday
.
getTime
();
const
dday
=
Math
.
abs
(
diffDate
/
(
1000
*
3600
*
24
));
console
.
log
(
dday
);
\ No newline at end of file
server.js
View file @
2e9c463
...
...
@@ -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