Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 19 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,32 @@
# Temporal in Rust

Temporal is a calendar and timezone aware date/time builtin currently
proposed for addition to the ECMAScript specification.
`temporal_rs` is a Rust date/time library that provides support for calendrical
calculations and time zones that is based on the Temporal specification.

`temporal_rs` is an implementation of Temporal in Rust that aims to be
100% test compliant. While initially developed for [Boa][boa-repo], the
crate has been externalized and is being used in other engines such as [V8](https://v8.dev) and [Kiesel](https://codeberg.org/kiesel-js/kiesel).
This implementation aims to be 100% test compliant. While initially developed
for [Boa][boa-repo], the crate was split from the engine repository for general
Rust usage and vendoring to other ECMAScript implementations.

For more information on `temporal_rs`'s general position in the Rust
date/time library ecoystem, see our [FAQ](./docs/FAQ.md).
For more information on `temporal_rs`'s general position in the Rust date/time
library ecoystem or whether we may address your use case, see our
[FAQ](./docs/FAQ.md).

Currently, `temporal_rs` is used in Boa, [Kiesel](https://codeberg.org/kiesel-js/kiesel),
and [V8](https://v8.dev) for the core functionality of their Temporal built-ins.

Temporal is an API for working with date and time in a calendar
and time zone aware manner.
## Project overview

temporal_rs is designed with ECMAScript implementations and general
purpose Rust usage in mind, meaning that temporal_rs can be used to implement
the Temporal built-ins in an ECMAScript implementation or generally
used as a date and time library in a Rust project.
This project publishes the following crates:

temporal_rs is the primary library for the Temporal API implementation in Boa, Kiesel,
and V8. Each of these engines pass the large ECMAScript conformance test suite for
the specification.
- [`temporal_rs`](https://docs.rs/temporal_rs/latest/temporal_rs/), the core date/time library
- [`temporal_capi`](https://docs.rs/temporal_capi/latest/temporal_capi/), a FFI crate for C and C++
- [`timezone_provider`](https://docs.rs/timezone_provider/latest/timezone_provider/), a time zone data provider crate
- [`zoneinfo_rs`](https://docs.rs/zoneinfo_rs/latest/zoneinfo_rs/), an experimental zoneinfo compiler crate

## Why use temporal_rs?

As previously mentioned, Temporal is an API for working with date and time in
a calendar and time zone aware manner. This means that calendar and time zone support
are first class in Temporal as well as in temporal_rs.
Temporal is a date and time library that is both calendar and time zone aware manner. This
means that calendar and time zone support are first class in Temporal.

For instance, converting between calendars is as simple as providing the calendar as
shown below.
Expand Down Expand Up @@ -82,7 +81,7 @@ assert_eq!(zdt_zurich.second(), 10);

```

## Overview
## Library Overview

temporal_rs provides 8 core types for working with date and time. The core types are:

Expand Down
3 changes: 2 additions & 1 deletion docs/FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ date/time API.

`temporal_rs` may fit your use case if any of the below are true:

- You need some level of web compatibility for your date/time libraries.
- You are implementing the Temporal API in a JavaScript engine or any
other language.
- You have internationalization date/time needs for different calendars
Expand Down Expand Up @@ -47,4 +48,4 @@ Other concerns:
These crates provide fantastic APIs for their intended goal, but most
are designed for use with the proleptic Gregorian calendar.

[ecma402-spec]: https://tc39.es/ecma402/
[ecma402-spec]: https://tc39.es/ecma402/
14 changes: 7 additions & 7 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
//! A native Rust implementation of ECMAScript's Temporal API.
//! The Rust implementation of ECMAScript's Temporal
//!
//! Temporal is an API for working with date and time in a calendar
//! and time zone aware manner.
//! Temporal is date and time library that provides support for calendrical calculations
//! and time zones based on the ECMAScript Temporal specification.
//!
//! temporal_rs is designed with ECMAScript implementations and general
//! purpose Rust usage in mind, meaning that temporal_rs can be used to implement
//! the Temporal built-ins in an ECMAScript implementation or generally
//! used as a date and time library in a Rust project.
//! temporal_rs is designed with general purpose Rust usage and ECMAScript implementations
//! in mind, meaning that temporal_rs can be used to implement the Temporal built-ins
//! in an ECMAScript implementation or generally used as a date and time library in a
//! Rust project.
//!
//! temporal_rs is the primary library for the Temporal API implementation in Boa, Kiesel,
//! and V8. Each of these engines pass the large ECMAScript conformance test suite for
Expand Down