Skip to content
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

Add datepicker widget #5533

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

hazemhashem
Copy link

Description:

This PR introduces a new DatePicker widget to allow users to select dates using dropdowns for year, month, and day. The widget is fully customizable and integrates seamlessly with the existing Fyne API.
Fixes #(issue)

Checklist:

  • Tests included.
    • I have added unit tests for the DatePicker widget in datepicker_test.go.
  • Lint and formatter run with no errors.
    • I ran go fmt and golint with no errors.
  • Tests all pass.
    • All tests pass locally. Here's the output of go test -v -run TestDatePicker:

=== RUN TestDatePicker
--- PASS: TestDatePicker (0.00s)
PASS
ok fyne.io/fyne/v2/widget 0.047s

```

Output :

Screenshot from 2025-02-14 18-34-29

@andydotxyz
Copy link
Member

How does this fit alongside the DateEntry?

I'm not sure about the 3 separate pickers - on mobile aren't these presented in a single keyboard/picker instead of directly in the user interface?

https://assets.website-files.com/6231812313e8661d7da3a4e7/62820ad35553f03e5fb5e1a0_13-Good-user-experience-datepicker-examples.png

@hazemhashem
Copy link
Author

You're absolutely right about the mobile usability concern. It slipped my mind because I don’t currently have an Android/iOS development environment to test mobile interfaces. My initial implementation is focused on desktop use cases, such as sign-up forms or other scenarios where a structured date selection might be more intuitive.

For desktop applications, having 3 separate pickers (year, month, day) can be beneficial in scenarios like:

  • Sign-up forms: Users can quickly select their date of birth without needing to open a popup.
  • Filters or dashboards: Users can easily adjust date ranges without navigating through a calendar.

I’d love to hear your thoughts on the following:

  • Should the 3 separate pickers remain as a single widget for desktop use?
  • Would it be better to move them into a custom dialog for better organization?
  • Should we consider adapting this for mobile use in a future update?

Your guidance would be greatly appreciated as I want to ensure this widget aligns with Fyne’s design principles and usability standards.

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.

2 participants