Skip to content

Commit

Permalink
Revert "bindings: remove Timestamp::to_human_datetime"
Browse files Browse the repository at this point in the history
From commit ea531b9 the library size issues were solved, so these cleanups aren't longer really needed.
This reverts commit f4de711

Signed-off-by: Yuki Kishimoto <[email protected]>
  • Loading branch information
yukibtc committed Jan 11, 2025
1 parent 9ac8d30 commit 209812b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
1 change: 0 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
* ffi: rename `Kind::from_enum` and `Kind::as_enum` to `Kind::from_std` and `Kind::as_std` ([Yuki Kishimoto])
* bindings: remove `profile` module ([Yuki Kishimoto])
* bindings: remove `NostrLibrary` struct and keep only `git_hash_version` func ([Yuki Kishimoto])
* bindings: remove `Timestamp::to_human_datetime` ([Yuki Kishimoto])

### Changed

Expand Down
5 changes: 5 additions & 0 deletions bindings/nostr-sdk-ffi/src/protocol/types/time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,9 @@ impl Timestamp {
pub fn as_secs(&self) -> u64 {
self.inner.as_u64()
}

/// Convert [`Timestamp`] to human datetime
pub fn to_human_datetime(&self) -> String {
self.inner.to_human_datetime()
}
}
6 changes: 6 additions & 0 deletions bindings/nostr-sdk-js/src/protocol/types/time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,10 @@ impl JsTimestamp {
pub fn as_secs(&self) -> f64 {
self.inner.as_u64() as f64
}

/// Convert `Timestamp` to human datetime
#[wasm_bindgen(js_name = toHumanDatetime)]
pub fn to_human_datetime(&self) -> String {
self.inner.to_human_datetime()
}
}

0 comments on commit 209812b

Please sign in to comment.