Immutable date and time library for JavaScript, ported from Java's ThreeTen backport with a domain-driven API.
js-joda is an immutable date and time library for JavaScript that provides a domain-driven API based on the ISO calendar system. It solves the limitations of the native JavaScript Date object and wrapper libraries by offering standalone, immutable date-time classes for precise handling of dates, times, timezones, durations, and periods.
JavaScript developers needing robust, immutable date-time handling, especially those working with frameworks like React or Flux, or applications requiring ISO 8601 compliance and timezone management.
Developers choose js-joda for its high performance, immutability, and clean domain-driven API, which reduces errors and aligns with modern JavaScript practices, offering a reliable alternative to libraries like Moment.js.
:clock2: Immutable date and time library for javascript
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
All date-time objects are immutable, aligning with pure functions and frameworks like React and Flux, reducing side effects in modern JavaScript applications.
Separate classes for different use cases, such as LocalDate for dates without times and ZonedDateTime for timezone-aware date-times, making code cleaner and error-safe.
Benchmarked 2 to 10 times faster than other JavaScript date libraries with a lightweight footprint of 43 kB minified and compressed, as stated in the README.
Built-in parsers and formatters for ISO 8601 (RFC 3339) with customization options, ensuring robust standard compliance for date handling.
Full functionality requires installing separate packages for timezone (@js-joda/timezone) and locale (@js-joda/locale) support, adding complexity to project setup.
The API is based on Java's java.time package, which may be unfamiliar to JavaScript developers accustomed to libraries like Moment.js, increasing initial learning effort.
Locale-specific formatting and parsing are not included in the core package; developers must add @js-joda/locale, delaying internationalization features.
js-joda is an open-source alternative to the following products: