time-rs / time

The most used Rust library for date and time handling.
https://time-rs.github.io
Apache License 2.0
1.13k stars 281 forks source link

Compile error with version 0.3.32 when compiling for wasm32-unknown-unknown #653

Closed lpotthast closed 10 months ago

lpotthast commented 10 months ago

Using time = { version = "0.3.32", features = [ "wasm-bindgen", "macros", "serde", "serde-well-known" ] } I get the following error when compiling for wasm32-unknown-unknown, which doesn't occur when using 0.3.31:

error[E0425]: cannot find value `Millisecond` in this scope
    --> /home/lukas/.cargo/registry/src/index.crates.io-6f17d22bba15001f/time-0.3.32/src/offset_date_time.rs:1600:69
     |
1600 |         let timestamp_nanos = (js_date.get_time() * Nanosecond::per(Millisecond) as f64) as i128;
     |                                                                     ^^^^^^^^^^^ not found in this scope
     |
help: consider importing one of these items
     |
3    + use crate::convert::Millisecond;
     |
3    + use time_core::convert::Millisecond;
     |
lpotthast commented 10 months ago

Ahh.. Had this tab open for too long :/ Was already reported in https://github.com/time-rs/time/issues/652. Closing this as a duplicate.