분류 Nodejs

날짜를 파싱, 유효성 검사, 조작 및 표시합니다.

컨텐츠 정보

  • 조회 351 (작성일 )

본문

https://github.com/moment/moment 

http://momentjs.com/


moment().subtract(10, 'days').calendar(); // 2019.06.13.
moment().subtract(6, 'days').calendar();  // 지난주 월요일 오전 10:07
moment().subtract(3, 'days').calendar();  // 지난주 목요일 오전 10:07
moment().subtract(1, 'days').calendar();  // 어제 오전 10:07
moment().calendar();                      // 오늘 오전 10:07
moment().add(1, 'days').calendar();       // 내일 오전 10:07
moment().add(3, 'days').calendar();       // 수요일 오전 10:07
moment().add(10, 'days').calendar();      // 2019.07.03.
                                         
moment.locale();         // ko
moment().format('LT');   // 오전 10:08
moment().format('LTS');  // 오전 10:08:04
moment().format('L');    // 2019.06.23.
moment().format('l');    // 2019.06.23.
moment().format('LL');   // 2019년 6월 23일
moment().format('ll');   // 2019년 6월 23일
moment().format('LLL');  // 2019년 6월 23일 오전 10:08
moment().format('lll');  // 2019년 6월 23일 오전 10:08
moment().format('LLLL'); // 2019년 6월 23일 일요일 오전 10:08
moment().format('llll'); // 2019년 6월 23일 일요일 오전 10:08
                         // undefined