All Projects → iamkun → Dayjs

iamkun / Dayjs

Licence: mit
⏰ Day.js 2kB immutable date-time library alternative to Moment.js with the same modern API

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Dayjs

dayjs
Extended fork of Day.js - 2KB immutable date library alternative to Moment.js
Stars: ✭ 36 (-99.9%)
Mutual labels:  time, datetime, date, moment, date-formatting, dayjs
moment-cache
⏱ Simple utility to cache moment.js results and speed up moment calls.
Stars: ✭ 29 (-99.92%)
Mutual labels:  time, datetime, date, moment
Angular Moment Picker
Angular Moment Picker is an AngularJS directive for date and time picker using Moment.js.
Stars: ✭ 536 (-98.57%)
Mutual labels:  time, date, datetime, moment
Time
Building a better date/time library for Swift
Stars: ✭ 1,983 (-94.69%)
Mutual labels:  time, date, datetime, date-formatting
chronos
One library to rule the time
Stars: ✭ 17 (-99.95%)
Mutual labels:  time, datetime, date, moment
format-date
📆 A small library (around 400 B when gziped & minified) to format JavaScript `Date` object using same tokens as moment.
Stars: ✭ 25 (-99.93%)
Mutual labels:  datetime, date, moment, date-formatting
rescript-date
📆 Date manipulation in ReScript.
Stars: ✭ 101 (-99.73%)
Mutual labels:  time, datetime, date
Date Io
Abstraction over common javascript date management libraries
Stars: ✭ 382 (-98.98%)
Mutual labels:  date, datetime, moment
Pendulum
Python datetimes made easy
Stars: ✭ 4,639 (-87.59%)
Mutual labels:  time, date, datetime
ember-dayjs-helpers
Ember Template helpers based on day.js
Stars: ✭ 19 (-99.95%)
Mutual labels:  datetime, date, dayjs
vue-timeselector
🕒 Simply customizable powerful time picker for Vue.js
Stars: ✭ 41 (-99.89%)
Mutual labels:  time, datetime, date
Carbon
A simple, semantic and developer-friendly golang package for datetime
Stars: ✭ 565 (-98.49%)
Mutual labels:  time, date, datetime
imrc-datetime-picker
(Improved) React component datetime picker by momentjs 📆
Stars: ✭ 21 (-99.94%)
Mutual labels:  datetime, date, moment
relative.time.parser
Moment.js Plugin for parsing Relative Time Strings
Stars: ✭ 13 (-99.97%)
Mutual labels:  time, date, moment
date-php
这是一个Javascript模仿PHP日期时间格式化函数,使用方法和PHP非常类似,有丰富的模板字符,并在原来的基础上增加了一些模板字符。 This is a date function that implement PHP in Javascript. It is very similar to PHP, has rich template characters, and enhances some template characters on the basis of the original.
Stars: ✭ 24 (-99.94%)
Mutual labels:  time, datetime, date
Period
PHP's time range API
Stars: ✭ 616 (-98.35%)
Mutual labels:  time, date, datetime
shamsi date
A Flutter and Dart package for using Jalali (Shamsi, Solar, Persian or Jalaali) calendar. You can convert, format and manipulate Jalali and Gregorian (Miladi) date and times.
Stars: ✭ 59 (-99.84%)
Mutual labels:  time, datetime, date
Vue Datetime
Mobile friendly datetime picker for Vue. Supports date and datetime modes, i18n and more.
Stars: ✭ 928 (-97.52%)
Mutual labels:  time, date, datetime
hs-hourglass
efficient and simpler time API for haskell
Stars: ✭ 43 (-99.88%)
Mutual labels:  time, datetime, date
dt
Go's missing DateTime package
Stars: ✭ 34 (-99.91%)
Mutual labels:  time, datetime, date

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

Day.js

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

Gzip Size NPM Version Build Status Codecov License
Sauce Test Status

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 for 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 it.

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

Sponsors

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

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].