Skip to content

Commit e2c7f7c

Browse files
authored
Add support for jiff v0.2 (#458)
1 parent e5a314d commit e2c7f7c

File tree

7 files changed

+147
-66
lines changed

7 files changed

+147
-66
lines changed

Cargo.lock

Lines changed: 45 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ export type User = { user_id: number, first_name: string, last_name: string, };
9393
| semver-impl | Implement `TS` for types from *semver* |
9494
| smol_str-impl | Implement `TS` for types from *smol_str* |
9595
| tokio-impl | Implement `TS` for types from *tokio* |
96+
| jiff-impl | Implement `TS` for types from *jiff* |
9697

9798
<br/>
9899

ts-rs/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ serde-json-impl = ["serde_json"]
3737
no-serde-warnings = ["ts-rs-macros/no-serde-warnings"]
3838
import-esm = []
3939
tokio-impl = ["tokio"]
40+
jiff-impl = ["jiff"]
4041

4142
[dev-dependencies]
4243
serde = { version = "1.0", features = ["derive"] }
@@ -62,3 +63,4 @@ indexmap = { version = "2", optional = true }
6263
ordered-float = { version = ">= 3, < 6", optional = true }
6364
serde_json = { version = "1", optional = true }
6465
tokio = { version = "1", features = ["sync"], optional = true }
66+
jiff = { version = "0.2", optional = true }

ts-rs/src/jiff.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
use jiff::{
2+
civil::{Date, DateTime, Time},
3+
Span, Timestamp, Zoned,
4+
};
5+
6+
use super::{impl_primitives, TS};
7+
8+
impl_primitives!(Date, DateTime, Span, Time, Timestamp, Zoned => "string");

0 commit comments

Comments
 (0)