Skip to content

Conversation

matwachich
Copy link
Contributor

@matwachich matwachich commented Jun 25, 2025

Description:

Some enhancements to Calendar widget and DateEntry

  • added localized month name
  • added a function to programmatically change the currently displayed date
  • added the ability to select a date, and a function to programmatically change the selected date
  • fixed crash when OnChanged callback in not set
  • calendar of DateEntry will now open with currently entered date selected
  • corrected Calendar popup positioning (do not resize the popup, keep it always at its minSize)
  • added a localized button under the Calendar in DateEntry to select today's date

What to discuss next:

  • adding a config variable WeekStart to Calendar to override configured first Week day
  • adding something similar for date format to DateEntry (did not do it, will have to study it)
  • discussing is it judicious and idiomatic that tapping the selected date in the calendar will unselect it (setting SelectedDate = time.Time{})

Another one I just want to understand:

  • Why using in DateEntry a *time.Time and not a time.Time ??? We can just set Date = time.Time{} (Zero-date) instead on nil

Checklist:

  • Tests included.
  • Lint and formatter run with no errors.
  • Tests all pass.

…with SelectedDate)

- added localized month name
- added a function to programmatically change the currently displayed date
- added the ability to select a date, and a function to programmatically change the selected date
- fixed crash when OnChanged callback in not set
- calendar of DateEntry will now open with currently entered date selected
- corrected Calendar popup positioning (do not resize the popup, keep it always at its minSize)
- SetDisplayedDate => SetDisplayedMonth
- Removed commented code
- Removed Resize handler in DateEntry (not needed)
@coveralls
Copy link

coveralls commented Jul 5, 2025

Coverage Status

coverage: 62.21% (-0.1%) from 62.312%
when pulling 4442950 on matwachich:calendar_additions
into 0c929c1 on fyne-io:develop.

@Jacalz
Copy link
Member

Jacalz commented Jul 6, 2025

Thanks for this. Though, I would like to point out that PRs that introduce new bigger features are usually easier to review and land if they focus on one at a time. Fixes and smaller changes can often be grouped together though. Not something you need to change now but it is worth keeping in mind m

@Jacalz Jacalz changed the title Calendar_additions Various improvements to calendar widget Jul 6, 2025
Copy link
Member

@Jacalz Jacalz left a comment

Choose a reason for hiding this comment

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

Sorry for the late review. I added some minor comments inline. It would also be good to add some tests for this. Also, please do tick the boxes in the PR template as appropriately.

@matwachich
Copy link
Contributor Author

matwachich commented Sep 11, 2025

Ok done for the inline comments.
For the tests, I have to admit that... I never wrote tests for fyne, nor for golang...
I vaguely know the principle, but have no clue how to really write usefull tests...
If someone could help about this :)

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.

5 participants