날짜1 [JS] 날짜 형식 커스텀 yyyy-mm-dd // dataFormat.js const leftPad = (value) => { if (value >= 10) { return value; } return `0${value}`; } const toStringByFormatting = (source, delimiter) => { const year = source.getFullYear(); const month = leftPad(source.getMonth() + 1); const day = leftPad(source.getDate()); return [year, month, day].join(delimiter); }; const dataFormat = { toStringByFormatting, }; export default dataFormat; 날짜.. 2023. 7. 19. 이전 1 다음