MCPcopy
hub / github.com/iamkun/dayjs

github.com/iamkun/dayjs @v1.11.21 sqlite

repository ↗ · DeepWiki ↗ · release v1.11.21 ↗
314 symbols 1,638 edges 323 files 0 documented · 0%
README

English | 简体中文 | 日本語 | Português Brasileiro | 한국어 | Español (España) | Русский | Türkçe | සිංහල | עברית

Day.js

Fast 2kB alternative to Moment.js with the same modern API

<a href="https://bundlephobia.com/package/dayjs"><img
        src="https://img.shields.io/bundlephobia/minzip/dayjs?style=flat-square&color=%2345cc11"
        alt="Gzip Size"></a>
<a href="https://www.npmjs.com/package/dayjs"><img src="https://img.shields.io/npm/v/dayjs.svg?style=flat-square&colorB=51C838"
                                                   alt="NPM Version"></a>
<a href="https://github.com/iamkun/dayjs/actions/workflows/check.yml"><img
        src="https://img.shields.io/github/actions/workflow/status/iamkun/dayjs/check.yml?style=flat-square" alt="Build Status"></a>
<a href="https://codecov.io/gh/iamkun/dayjs"><img
        src="https://img.shields.io/codecov/c/github/iamkun/dayjs/master.svg?style=flat-square" alt="Codecov"></a>
<a href="https://github.com/iamkun/dayjs/blob/master/LICENSE"><img
        src="https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square" alt="License"></a>



<a href="https://saucelabs.com/u/dayjs">
    <img width="750" src="https://user-images.githubusercontent.com/17680888/40040137-8e3323a6-584b-11e8-9dba-bbe577ee8a7b.png" alt="Sauce Test Status">
</a>

Day.js is a minimalist JavaScript library that parses, validates, manipulates, and displays dates and times for modern browsers with a largely Moment.js-compatible API. If you use Moment.js, you already know how to use Day.js.

dayjs().startOf('month').add(1, 'day').set('year', 2018).format('YYYY-MM-DD HH:mm:ss');
  • 🕒 Familiar Moment.js API & patterns
  • 💪 Immutable
  • 🔥 Chainable
  • 🌐 I18n support
  • 📦 2kb mini library
  • 👫 All browsers supported

Getting Started

Documentation

You can find more details, API, and other docs on day.js.org website.

Installation

npm install dayjs --save

📚Installation Guide

API

It's easy to use Day.js APIs to parse, validate, manipulate, and display dates and times.

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 Reference

I18n

Day.js has great support for internationalization.

But none of them will be included in your build unless you use them.

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

📚Internationalization

Plugin

A plugin is an independent module that can be added to Day.js to extend functionality or add new features.

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

📚Plugin List

Downloads

Day.js Chart

Sponsors

Support this project by becoming a sponsor. Your logo will show up here with a link to your website.

[Become a sponsor via Github] [Become a sponsor via OpenCollective]

                                                      Instagram Story Viewer          Sayfone Cheap international calls                   BestKru                   Route Optimizer and Route Planner Software                           

Contributors

This project exists thanks to all the people who contribute.

Please give us a 💖 star 💖 to support us. Thank you.

And thank you to all our backers! 🙏

License

Day.js is licensed under a MIT License.

Extension points exported contracts — how you extend this code

Duration (Interface)
(no doc) [1 implementers]
types/plugin/duration.d.ts
ConfigTypeMap (Interface)
(no doc)
types/index.d.ts
ILocale (Interface)
(no doc)
types/locale/types.d.ts
Dayjs (Interface)
(no doc)
types/plugin/quarterOfYear.d.ts
FormatObject (Interface)
(no doc)
types/index.d.ts
Locale (Interface)
(no doc)
types/locale/index.d.ts
Dayjs (Interface)
(no doc)
types/plugin/isLeapYear.d.ts
RelativeTimeThreshold (Interface)
(no doc)
types/plugin/relativeTime.d.ts

Core symbols most depended-on inside this repo

dayjs
called by 1933
src/index.js
format
called by 861
types/plugin/duration.d.ts
locale
called by 469
types/plugin/duration.d.ts
valueOf
called by 424
src/index.js
add
called by 373
types/plugin/duration.d.ts
set
called by 171
types/plugin/objectSupport.d.ts
utc
called by 169
types/plugin/utc.d.ts
utcOffset
called by 161
types/plugin/utc.d.ts

Shape

Method 165
Function 104
Interface 39
Class 6

Languages

TypeScript100%

Modules by API surface

src/index.js42 symbols
src/plugin/duration/index.js40 symbols
types/plugin/duration.d.ts28 symbols
types/plugin/localeData.d.ts22 symbols
types/plugin/pluralGetSet.d.ts10 symbols
types/plugin/quarterOfYear.d.ts9 symbols
types/plugin/isoWeek.d.ts9 symbols
src/plugin/customParseFormat/index.js8 symbols
types/plugin/relativeTime.d.ts7 symbols
types/plugin/timezone.d.ts6 symbols
src/utils.js6 symbols
types/plugin/utc.d.ts5 symbols

Dependencies from manifests, versioned

@babel/cli7.0.0-beta.44 · 1×
@babel/core7.0.0-beta.44 · 1×
@babel/node7.0.0-beta.44 · 1×
@babel/preset-env7.0.0-beta.44 · 1×
@semantic-release/github11.0.4 · 1×
babel-core7.0.0-bridge.0 · 1×
babel-jest22.4.3 · 1×
babel-plugin-external-helpers6.22.0 · 1×
cross-env5.1.6 · 1×
eslint4.19.1 · 1×
eslint-config-airbnb-base12.1.0 · 1×
eslint-plugin-import2.10.0 · 1×

For agents

$ claude mcp add dayjs \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact