export const yymmdd = (date) => [
  date.getFullYear(),
  date.getMonth() + 1 < 10 ? `0${date.getMonth() + 1}` : date.getMonth() + 1,
  date.getDate() < 10 ? `0${date.getDate()}` : date.getDate()
]

export const daySince = (dateStr) => {
  const date1 = new Date()
  const date2 = new Date(dateStr)
  const date = (date1.getTime() - date2.getTime()) / (24 * 60 * 60 * 1000)
  return parseInt(date)
}
