occidere / DailyOMG

DailyOMG

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Days Diff 구하는 부분 수정 필요

occidere opened this issue · comments

Days Diff 구하는 부분 수정 필요

상황

  • 기존 방식으로는 month 나 year 의 diff 를 무시하고 계산함.
  • 즉, 2018-09-01 과 2018-10-02를 비교하면 1일 이라고 나옴

개선

  • 아래 방법을 적용하면 year 와 month 를 포함해서 차이를 구할 수 있음
long diff = Math.abs(ChronoUnit.DAYS.between(now, old))

대상

https://github.com/occidere/DailyOMG/search?q=Period&unscoped_q=Period

hotfix/fixDateDiff