Skip to content

Better Calendar interface #107

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from
Draft

Better Calendar interface #107

wants to merge 10 commits into from

Conversation

ddudenin
Copy link

@ddudenin ddudenin commented Aug 7, 2025

Plan

  • Replace custom CalendarDate with chrono.
  • Replace numeric weekday / month representations with native Rust enum types (chrono::Month and chrono::Weekday).
  • Implement string conversion function to support i18n with dynamic language switching.
  • Add support for custom month labels.
  • Pass tests.
    • Compilation.
    • Check, clippy tests.
    • Doc comments.
    • Playwright.

@ddudenin ddudenin changed the title use chrono for calendar Better Calendar interface Aug 7, 2025
@npatsakula
Copy link
Contributor

@ealmloff, can we add dioxus-i18n dependency into preview crate? We'd like to add example of localization that I mentioned in issue.

(ctx.set_view_date)(view_date);
}
ctx.focused_date.set(Some(new_date));
};
match e.key() {
Key::ArrowLeft => {
e.prevent_default();
set_focused_date(focused_date.prev_day());
set_focused_date(focused_date - Days::new(1));
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider using NaiveDay::pred_opt() instead of subtraction (it's panicking under the hood):

https://docs.rs/chrono/latest/chrono/struct.NaiveDate.html#method.pred_opt

@ealmloff
Copy link
Member

ealmloff commented Aug 8, 2025

@ealmloff, can we add dioxus-i18n dependency into preview crate? We'd like to add example of localization that I mentioned in issue.

Yes, a dioxus-i18n variant of the calendar would be great. I'm not as concerned about dependencies/build times on the preview crate because you can easily modify the styled components when you copy them into your project

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.

3 participants