Skip to content

Conversation

@djmaze
Copy link
Contributor

@djmaze djmaze commented Jan 12, 2026

The utc_now() function is also exported in order to be available to the importing app.

I admit this is a rather ugly workaround. Also, I am not a Rust expert. I would understand if this was not accepted.

fixes #184

@djmaze djmaze marked this pull request as draft January 12, 2026 23:27
The utc_now() function is also exported in order to be available to the
importing app.
pub fn Demo() -> Element {
let mut selected_date = use_signal(|| None::<Date>);
let mut view_date = use_signal(|| UtcDateTime::now().date());
let mut view_date = use_signal(|| utc_now().date());
Copy link
Member

@ealmloff ealmloff Jan 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The existing version seems to work fine in the preview: https://dioxuslabs.github.io/components/component/?name=calendar. Do you have the time crate pinned elsewhere which could be pulling in a different version? It looks like the preview has time = 0.3.44

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh well.. I found out what was missing for me. In my Cargo.toml:

web = ["time/wasm-bindgen"]

That makes it work, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Calendar & Datepicker components do not work on web (wasm) target

2 participants