CustomParseFormat
CustomParseFormat 플러그인은 dayjs()
생성자가 사용자 정의 포맷 문자열을 사용하여 날짜를 파싱할 수 있도록 확장합니다.
javascript
var customParseFormat = require('dayjs/plugin/customParseFormat');
// import customParseFormat from 'dayjs/plugin/customParseFormat' // ES 2015
dayjs.extend(customParseFormat);
dayjs('05/02/69 1:02:03 PM -05:00', 'MM/DD/YY H:mm:ss A Z');
// 1969년 5월 2일 18시 02분 03초 (UTC)를 나타내는 Day.js 인스턴스가 반환됩니다.
dayjs('2018 Enero 15', 'YYYY MMMM DD', 'es');
// 2018년 1월 15일 00시 00분 00초 (UTC)를 나타내는 Day.js 인스턴스가 반환됩니다.
dayjs('1970-00-00', 'YYYY-MM-DD', true); // 엄격한 파싱 (strict parsing)