phueper / js-joda

0 stars 0 forks source link

Immutable date and time library for JavaScript

npm version Build Status Sauce Test Status Coverage Status [Tested node version]() lerna

Sauce Test Status

Introduction

js-joda is an immutable date and time library for JavaScript. It provides a simple, domain-driven and clean API based on the ISO8601 calendar.

Why yet another JavaScript date and time library?

The threeten domain models

Dates and Times

Duration and Period

Additional value types

Getting started

Node

Install joda using npm

npm install js-joda

Then require it to any module

var LocalDate = require('js-joda').LocalDate;

var d = LocalDate.parse('2012-12-24').atStartOfDay().plusMonths(2); // 2013-02-24T00:00:00

Browser

To use js-joda from a browser, download either dist/js-joda.min.js or dist/js-joda.js (with sourcemaps for development). Then add it as a script tag to your page

<script src="https://github.com/phueper/js-joda/raw/monorepo/js-joda.min.js"></script>
<script>
    var LocalDate = JSJoda.LocalDate;
    var d = LocalDate.parse('2012-12-24').atStartOfDay().plusMonths(2); // 2013-02-24T00:00:00
</script>

Documentation

Roadmap

Milestone 1: Core domains (reached with version v1.0.0)

Milestone 2: IANA timezone support (reached with version v1.2.0)

Milestone 3: Locale support (reached with v2.0.0 of js-joda-locale)

see the plugin js-joda-locale

Future Milestones

Contributing

Contributions are always welcome. Before contributing please read the code of conduct & search the issue tracker. We use GitHub issues. Your issue may have already been discussed or fixed. To contribute, fork js-joda, commit your changes, & send a pull request.

By contributing to js-joda, you agree that your contributions will be licensed under its BSD license.

Note that only pull requests and issues that match the threeten backport API will be considered. Additional requested features will be rejected.

License

js-joda uses the ThreeTen-Backport implementation (http://www.threeten.org/threetenbp/) as a reference base for implementation. This allows us to release js-joda under the BSD License while the OpenJDK java.time implementation is under GNU GPL+linking exception. The API of the ThreeTen-Backport is mostly identical to the official Java SE 8 API from the view of our JavaScript port.

The API of this project (as far as possible with JavaScript), a lot of implementation details and documentation are just copied but never equalled.