Skip to content

Commit 771b0a6

Browse files
committed
Add some FAQ style docs for temporal_rs
1 parent ad46374 commit 771b0a6

File tree

2 files changed

+55
-3
lines changed

2 files changed

+55
-3
lines changed

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ proposed for addition to the ECMAScript specification.
88
crate has been externalized as we intended to make an engine agnostic
99
and general usage implementation of Temporal and its algorithms.
1010

11+
For more information on `temporal_rs`'s general position in the Rust
12+
date/time library ecoystem, see our [FAQ](./docs/FAQ.md).
13+
1114
## Example usage
1215

1316
Below are a few examples to give an overview of `temporal_rs`'s current
@@ -49,7 +52,8 @@ assert_eq!(pdt.second(), 10);
4952

5053
### Create a `ZonedDateTime` for a RFC9557 IXDTF string.
5154

52-
**Important Note:** The below API is enabled with the `compiled_data` feature flag.
55+
**Important Note:** The below API is enabled with the `compiled_data`
56+
feature flag.
5357

5458
```rust
5559
use temporal_rs::{ZonedDateTime, TimeZone};
@@ -101,8 +105,8 @@ information.
101105

102106
<!-- TODO: Potentially update with tests if a runner can be implemented -->
103107

104-
The `temporal_rs`'s current conformance results can be viewed on
105-
Boa's [test262 conformance page](https://boajs.dev/conformance).
108+
The `temporal_rs`'s current conformance results can be viewed on Boa's
109+
[test262 conformance page](https://boajs.dev/conformance).
106110

107111
## FFI
108112

docs/FAQ.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# FAQ
2+
3+
## Why should I use `temporal_rs`?
4+
5+
`temporal_rs` implements the Temporal API in Rust.
6+
7+
The Temporal API is designed to be a calendar and time zone aware
8+
date/time API.
9+
10+
`temporal_rs` may fit your use case if any of the below are true:
11+
12+
- You are implementing the Temporal API in a JavaScript engine or any
13+
other language.
14+
- You have internationalization date/time needs for different calendars
15+
that do not involve the ISO / propoleptic Gregorian calendar.
16+
- You really like the JavaScript Temporal built-in and would like to use
17+
a similar API that you are familiar with.
18+
- Idk, are you a big ECMA402 fan? Than we might be your jam.
19+
20+
## Why not use `jiff` to implement Temporal?
21+
22+
There are a few reasons why `jiff` was not used for Boa's Temporal
23+
implementation.
24+
25+
Primary reasons:
26+
27+
- `temporal_rs` is older than `jiff`; so, it was not an option when the
28+
work on `temporal_rs` began
29+
- `jiff` is inspired by Temporal, while `temporal_rs` aims to be a 100%
30+
compliant implementation. `jiff` can break from the specification if
31+
it would like where `temporal_rs` is bound to the specification
32+
behavior.
33+
34+
Other concerns:
35+
36+
- Time zones are designed around the concept of BYOP (Bring your own
37+
provider). This is VERY important for engines to be able to define
38+
their own time zone providers.
39+
- Without feature flags, `temporal_rs`'s `Now` does not ship with a
40+
clock as this is left to JavaScript engines.
41+
- Calendar support is first class in `temporal_rs`. The library aims to
42+
support all ECMA402 defined calendars. `jiff` primarily implements the
43+
ISO calendar with some support for other calendars through `jiff_icu`.
44+
45+
## Why not use other date/time Rust crates `chrono`, `time` and `hifitime`?
46+
47+
These crates provide fantastic APIs for their intended goal, but most
48+
are designed for use with the propoleptic Gregorian calendar.

0 commit comments

Comments
 (0)