자바스크립트

const  curDate   =new Date();

   const firstDay = new Date(
                curDate.getFullYear(),
                curDate.getMonth(),
                1
            ).getTime();


            const lastDay = new Date(
                curDate.getFullYear(),
                curDate.getMonth() + 1,
                0,
                23,
                59,
                29
            ).getTime();

console.log(" firstDay : lastDay ", firstDay, lastDay);


    const increaseMonth = () => {
        setCurDate(
            new Date(curDate.getFullYear(), curDate.getMonth() + 1, curDate.getDate())
        )
    }

    const decreaseMonth = () => {
        setCurDate(
            new Date(curDate.getFullYear(), curDate.getMonth() - 1, curDate.getDate())
        )
    }

 

 

 

diaryList.filter((it) => firstDay <= it.date && it.date <= lastDay)

 

 

 

 

 

 

 

about author

PHRASE

Level 60  라이트

벌거숭이로 나는 이 세상에 왔다. 또한 벌거숭이로 이 세상을 떠나야 한다. -세르반테스

댓글 ( 4)

댓글 남기기

작성