codestates / codestates/EatMeUp

[DEV LOG] 2021.10.02 이세경

Open
#108 0 comments 0 reactions 0 assignees View on GitHub
dev-log
Dominant language
JavaScript
Stars
5
Forks
2
PR merge metrics
No merged PRs in 30d

Description

### COMMIT -m
- 냉장고 속 음식 유통기한 표시하기

### ISSUE
- new Date()함수를 이용해서 현재 날짜를 가져올 수 있었지만, 현재날짜랑 유통기한날짜를 계산하는 것이 틀려서 구글링을 통해 찾음
- getTime(), getMonth(), getFullYear()에 대한 개념을 이해하지 못함
- month같은경우 +1을 해주어야 한다.

```
const day = Math.floor(distance/(1000*60*60*24));
const hours = Math.floor((distance % (1000*60*60*24))/(1000*60*60));
const minutes = Math.floor((distance % (1000*60*60))/(1000*60));
const seconds = Math.floor((distance % (1000*60))/1000);

const setDateMonth = setDate.getMonth() + 1;
```
### TODO NEXT
1. [ ] 구글링
2. [ ] 날짜계산하는 법 잘 알아두기

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.