DateSet.js 629 Bytes
Newer Older
Kim, Subin's avatar
Kim, Subin committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import moment from 'moment';
import styles from "./calendar.module.scss";

const DateSet = ({ index, info, today, handleClick }) => {
    const week = ['', '', '', '', '', '', '']

    return (
        <div className="col d-flex flex-column text-center" onClick={() => handleClick(info.date)}>
            <span className="text-center">{week[index]}</span>
            <span className={today ? `rounded-circle ${styles.today}` : ""}>{moment(info.date).format("DD")}</span>
            <span className="text-secondary">{info.rate ? info.rate + "%" : null}</span>
        </div>
    )
}

export default DateSet