๋ฐ์ํ
Intro
moment.js ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ์ฌ์ฉํ์ฌ ๋ ์ง ๊ฐ์ฒด๋ฅผ ๋ค๋ฃจ๋ ๋์ค ๋ค์๊ณผ ๊ฐ์ ์ค๋ฅ๊ฐ ๋ฐ์ํ์ต๋๋ค.
Deprecation warning: value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/for more info.
Why?
๊ตฌ๊ธ๋ง์ ํด๋ณด๋, ํด๋น ์๋ฌ๋ moment ํจ์์์ ์ง์ํ์ง ์๋ ํ์์ ๊ฐ์ ์ ๋ ฅํ์ ๋ ๋ฐ์ํ๋ค๊ณ ํฉ๋๋ค.
https://stackoverflow.com/questions/17987647/moment-js-transform-to-date-object
How to solve the problem
์ stackoverflow ํ์ด์ง์ ์ฌ๋ฌ ๋ต๋ณ์ด ๋ฌ๋ ธ๋๋ฐ์, ๊ทธ ์ค์์
moment().toDate();
์ ์ฝ๋๋ฅผ ํ์ฉํ์ฌ ๋ ์ง ํ์์ ๋ฐ๊ฟ์ฃผ๋ ์๋ฌ๊ฐ ๋ฐ์ํ์ง ์์์ต๋๋ค.
๋ฐ์ํ
'Programming > JavaScript' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[JavaScript] ํน์ ๋ฌธ์์ด ์ ๊ฑฐํ๋ ๋ฐฉ๋ฒ (0) | 2023.01.09 |
---|---|
[JavaScript] ํ์์กด time zone offset ๊ตฌํ๋ ๋ฐฉ๋ฒ (0) | 2023.01.07 |
[JavaScript] Math.floor()์ด๋? (0) | 2022.12.14 |
[JavaScript] parseInt()์ด๋? (0) | 2022.12.14 |
[JavaScript] ์ต๋ช ํจ์(Anonymous function) ๋ ๋ฌด์์ธ๊ฐ? (0) | 2022.10.12 |