All Projects → 3846masa → lit-date

3846masa / lit-date

Licence: MIT license
Light-weight, faster datetime formatter for modern browsers.

Programming Languages

javascript
184084 projects - #8 most used programming language
typescript
32286 projects

Projects that are alternatives of or similar to lit-date

vue-translated
Internationalization (i18n) and localization (l10n) library for Vue.js v2.
Stars: ✭ 19 (-42.42%)
Mutual labels:  time, formatter, date, format
Gostradamus
Gostradamus: Better DateTimes for Go 🕰️
Stars: ✭ 148 (+348.48%)
Mutual labels:  time, datetime, date, format
Tinydate
A tiny (349B) reusable date formatter. Extremely fast!
Stars: ✭ 990 (+2900%)
Mutual labels:  time, datetime, date, format
format-date
📆 A small library (around 400 B when gziped & minified) to format JavaScript `Date` object using same tokens as moment.
Stars: ✭ 25 (-24.24%)
Mutual labels:  formatter, datetime, date, format
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 (-27.27%)
Mutual labels:  time, datetime, date, format
Translatedjs
Internationalization and localization for JavaScript and Node.js
Stars: ✭ 17 (-48.48%)
Mutual labels:  time, formatter, date, format
Time Stamp
Get a formatted timestamp. Used in gulp, assemble, generate, and many others.
Stars: ✭ 104 (+215.15%)
Mutual labels:  time, datetime, date, format
Time
Building a better date/time library for Swift
Stars: ✭ 1,983 (+5909.09%)
Mutual labels:  time, datetime, date
Graphql Java Datetime
GraphQL ISO Date is a set of RFC 3339 compliant date/time scalar types to be used with graphql-java.
Stars: ✭ 89 (+169.7%)
Mutual labels:  time, datetime, date
ptera
Ptera is DateTime library for Deno
Stars: ✭ 62 (+87.88%)
Mutual labels:  time, datetime, date
Delorean
Delorean: Time Travel Made Easy
Stars: ✭ 1,793 (+5333.33%)
Mutual labels:  time, datetime, date
Iso8601
Ruby parser to work with ISO8601 dateTimes and durations — http://en.wikipedia.org/wiki/ISO_8601
Stars: ✭ 70 (+112.12%)
Mutual labels:  time, datetime, date
Date And Time
A Minimalist DateTime utility for Node.js and the browser
Stars: ✭ 99 (+200%)
Mutual labels:  time, date, format
Date
A date and time library based on the C++11/14/17 <chrono> header
Stars: ✭ 2,389 (+7139.39%)
Mutual labels:  time, datetime, date
Date Picker
📅 Custom responsive date picker widget for Android, written in Kotlin.
Stars: ✭ 146 (+342.42%)
Mutual labels:  time, datetime, date
Luatz
Time, Date and Timezone library for lua
Stars: ✭ 92 (+178.79%)
Mutual labels:  time, datetime, date
Carbon
A simple PHP API extension for DateTime
Stars: ✭ 75 (+127.27%)
Mutual labels:  time, datetime, date
Dateparse
GoLang Parse many date strings without knowing format in advance.
Stars: ✭ 1,365 (+4036.36%)
Mutual labels:  time, datetime, date
Jiffy
Jiffy is a Flutter (Android, IOS and Web) date time package inspired by momentjs for parsing, manipulating, querying and formatting dates
Stars: ✭ 238 (+621.21%)
Mutual labels:  time, datetime, date
Calendar
📅 PHP Date & Time library that solves common problems in object oriented, immutable way.
Stars: ✭ 113 (+242.42%)
Mutual labels:  time, datetime, date

lit-date

NPM filesize codecov

Light-weight, faster datetime formatter for modern browsers.

lit-date is ...

  • Formatter for Date object
  • 👼 Light-weight (~1kB gzipped!)
  • 🦄 Very faster than other datetime libraries (e.g. moment)
  • 🆕 Powered by Template literals

Install

Node.js

npm i --save lit-date
# -- OR --
yarn add lit-date

Browser

<script src="https://unpkg.com/lit-date"></script>
<script type="module">
  import litdate from 'https://unpkg.com/lit-date?module';
</script>

Usage

const text = litdate`${'YYYY'}/${'MM'}/${'DD'}`(new Date());
console.log(text);
// i18n
const dayOfWeek = ({ dayOfWeek }) => [...'日月火水木金土'][dayOfWeek];
const format = litdate`${'M'}${'D'}${dayOfWeek}曜日`;
console.log(format(new Date()));

See examples.

Benchmark

See benchmarks for more details.

Basic usage

  • new Date() -> 2000/01/06
Chrome Firefox
Basic usage / Chrome Basic usage / Firefox

Advanced usage

  • new Date() -> 1月6日(木)
Chrome Firefox
Advanced usage / Chrome Advanced usage / Firefox

Bundle size

size gzip
tinydate tinydate_size tinydate_gzip
time-stamp time-stamp_size time-stamp_gzip
lit-date lit-date_size lit-date_gzip
tinytime tinytime_size tinytime_gzip
date-format date-format_size date-format_gzip
dateformat dateformat_size dateformat_gzip
formatoid formatoid_size formatoid_gzip
fecha fecha_size fecha_gzip
dayjs dayjs_size dayjs_gzip
date-fns date-fns_size date-fns_gzip
luxon luxon_size luxon_gzip
moment moment_size moment_gzip

Contribute

PRs accepted.

License

MIT (c) 3846masa

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].