New:Socket for Asana Is Now Available.Learn more
Get Started

esday

Package Overview
Dependencies
Maintainers
2
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

esday

A simple date library fully written in TypeScript

latest
Source
npmnpm
Version
1.1.0
Version published
Weekly downloads
11
-59.26%
Maintainers
2
Weekly downloads
 
Created
Source

EsDay

npm License: MIT PRs Welcome

Repository changing ownership

On the 6th of January 2026 this repository changed the ownership to one of it's maintainers, BePo65 to reduce the workload on g-mero.

Concepts

EsDay is a JavaScript library inspired by Day.js.

Esday has an API largely similar to Day.js (v1.11.13), but it is written in TypeScript and fully supports es modules.

Being compatible to Day.js, EsDay is also a good replacement for Moment.js.

Highlights

  • Modern API: Provides the same API as Day.js, with some features moved to plugins for a simpler core.
  • Immutable: esday is immutable, which means that all operations will return a new instance of esday.

Basic use

import { esday } from 'esday'
import { isTodayPlugin } from 'esday/plugins/isToday'

esday.extend(isTodayPlugin)

esday('2024-12-10').set('year', 2025).add(1, 'month').isToday()

For detailed information see the full documentation.

Differences to Day.js

  • Locale is a Plugin: no default locale!
  • default value for 'Start of Week' is 1 (as in ISO 8601): 'Start of Week' is 1 ('Monday').
  • default value for 'Start of Year' is 4 (as in ISO 8601): 'Start of Year' is 4.
  • clamping month on set: when changing the month and the new month does not have enough days to keep the current day of month, esday behaves like moment.js and clamps to the end of the target month
  • Invalid Date: conforms to Moment.js and uses Invalid date instead of Invalid Date.
  • plugin AdvancedParse got replaced by CustomParseFormat.
  • plugin ArraySupport: functionality is part of esday core.
  • plugin IsoWeeksInYear: functionality is part of plugin IsoWeek.
  • plugin PreParsePostFormat: functionality is part of esday core.
  • plugin UpdateLocale: functionality is part of plugin Locale.
  • plugin weekOfYear: functionality is part of plugin Week.
  • plugin WeekYear: functionality is part of plugin Week.
  • plugin Weekday: functionality is part of plugin Week.

Differences to Moment.js

Esday uses moment@2.30.1 as api reference.

  • toString: conforms to Day.js and uses Date.toUTCString() (returning the date in RFC 7231 format 'ddd, DD MMM YYYY HH:mm:ss [GMT]') while moment uses the format 'ddd MMM DD YYYY HH:mm:ss [GMT]ZZ'.
  • toISOString: conforms to Day.js and returns 'Invalid date' when called on an invalid date. In that case moment returns null (see moment pr#3710).

Contribute

In the folder dev there is a template for creating new plugins and a template for new locale definitions.

License

This project is licensed under the MIT License.

This project also partially contains code derived or copied from the following projects:

Keywords

dayjs

FAQs

Package last updated on 01 Aug 2026

Related posts