Skip to main content
Module

x/dayjs/docs/ko/README-ko.md

⏰ Day.js 2kB immutable date-time library alternative to Moment.js with the same modern API
Latest
File

한국어 | English | 简体中文 | 日本語 | Português Brasileiro | Español (España) | Русский| עברית

Day.js

Moment.js와 호환되는 API를 가진 경량 라이브러리 (2kB)


Gzip Size NPM Version Build Status Codecov License
Sauce Test Status

Day.js는 대부분의 API가 Moment.js와 호환되며 최신 브라우저에서 날짜와 시간에 대한 구문 분석, 유효성 검사, 조작, 출력을 간편하게 처리하는 경량 JavaScript 라이브러리 입니다. Moment.js를 사용해본 경험이 있다면, Day.js도 쉽게 사용하실 수 있습니다.

dayjs()
  .startOf('month')
  .add(1, 'day')
  .set('year', 2018)
  .format('YYYY-MM-DD HH:mm:ss')
  • 🕒 친숙한 Moment.js API와 패턴
  • 💪 불변 오브젝트(Immutable)
  • 🔥 메소드 체인(Chainable)
  • 🌐 I18n 지원
  • 📦 2kb 미니 라이브러리
  • 👫 모든 브라우저 지원

시작해볼까요!

문서

더 많은 세부 사항과 API 및 다른 문서는 day.js.org 웹사이트에서 확인하실 수 있습니다.

설치

npm install dayjs --save

📚설치 가이드

API

Day.js API를 사용하여 날짜와 시간의 구문 분석, 검증, 조작, 출력을 간편하게 처리할 수 있습니다.

dayjs('2018-08-08') // parse

dayjs().format('{YYYY} MM-DDTHH:mm:ss SSS [Z] A') // display

dayjs()
  .set('month', 3)
  .month() // get & set

dayjs().add(1, 'year') // manipulate

dayjs().isBefore(dayjs()) // query

📚API 참고

I18n

Day.js는 국제화에 대한 많은 지원을 제공하고 있습니다.

하지만 이 기능을 사용하지 않는 경우, 빌드에 포함되지 않습니다.

import 'dayjs/locale/es' // load on demand

dayjs.locale('es') // use Spanish locale globally

dayjs('2018-05-05')
  .locale('zh-cn')
  .format() // use Chinese Simplified locale in a specific instance

📚I18n

Plugin

플러그인은 Day.js의 기능을 확장하거나 새로운 기능을 도입하기 위한 독립적인 모듈입니다.

import advancedFormat from 'dayjs/plugin/advancedFormat' // load on demand

dayjs.extend(advancedFormat) // use plugin

dayjs().format('Q Do k kk X x') // more available formats

📚플러그인 목록

사용 트렌드

License

Day.js는 MIT License를 사용합니다.