Skip to content

Add ability to upper case week days text by setting upperCaseWeekDays#392

Open
vanyasem wants to merge 1 commit intohyochan:mainfrom
vanyasem:sem-capitalize-weekdays-param
Open

Add ability to upper case week days text by setting upperCaseWeekDays#392
vanyasem wants to merge 1 commit intohyochan:mainfrom
vanyasem:sem-capitalize-weekdays-param

Conversation

@vanyasem
Copy link
Copy Markdown
Contributor

Non-breaking change
Adds support for an optional parameter upperCaseWeekDays, which makes weekDays text uppercase

@hyochan hyochan added the enhancement New feature or request label Mar 19, 2025
Copy link
Copy Markdown
Owner

@hyochan hyochan left a comment

Choose a reason for hiding this comment

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

I agree that while providing a CustomWeekdayBuilder to build Weekdays in a different form is useful, adding upperCaseWeekDays for simpler modifications is a good idea. However, it might be clearer if an enum type that supports this kind of formatting were provided as well. Additionally, I think it would be helpful to explicitly state that the priority of this approach is lower than that of CustomWeekdayBuilder. What are your thoughts on this?

@vanyasem
Copy link
Copy Markdown
Contributor Author

@hyochan

an enum type that supports this kind of formatting were provided as well

Are you talking about including it in the WeekdayFormat enum, or about creating a new enum to specify weekday styling?

I think it would be helpful to explicitly state that the priority of this approach is lower

Absolutely agree on that one

@hyochan
Copy link
Copy Markdown
Owner

hyochan commented Mar 20, 2025

@hyochan

an enum type that supports this kind of formatting were provided as well

Are you talking about including it in the WeekdayFormat enum, or about creating a new enum to specify weekday styling?

I think it would be helpful to explicitly state that the priority of this approach is lower

Absolutely agree on that one

In this case a new enum to specify weekday styling and wanted to hear your thought!

@github-actions
Copy link
Copy Markdown
Contributor

This PR is stale because it has been open 90 days with no activity. Leave a comment or this will be closed in 7 days

@vanyasem
Copy link
Copy Markdown
Contributor Author

The PR is not stale!
I will get back to it some time in the following month
Haven't had much free time lately

@github-actions
Copy link
Copy Markdown
Contributor

This PR is stale because it has been open 90 days with no activity. Leave a comment or this will be closed in 7 days

@vanyasem
Copy link
Copy Markdown
Contributor Author

Still planning on continuing this some time later

@github-actions
Copy link
Copy Markdown
Contributor

This PR is stale because it has been open 90 days with no activity. Leave a comment or this will be closed in 7 days

@vanyasem
Copy link
Copy Markdown
Contributor Author

Still planning on continuing this some time later

@hyochan
Copy link
Copy Markdown
Owner

hyochan commented Apr 22, 2026

/gemini review

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces an upperCaseWeekDays property to the CalendarCarousel and WeekdayRow components to allow for uppercase weekday labels. Feedback suggests applying this transformation to the weekday names before they are passed to custom builders for consistency and renaming the property to upperCaseWeekdays within the WeekdayRow class to match existing naming conventions.

Comment thread lib/src/weekday_row.dart
style: defaultWeekdayTextStyle,
child: Text(
weekDayName,
upperCaseWeekDays ? weekDayName.toUpperCase() : weekDayName,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The upperCaseWeekDays transformation is currently only applied to the default Text widget. If a customWeekdayBuilder is provided, it receives the original weekDayName string without the uppercase transformation. For a more consistent user experience, the transformation should ideally be applied to the string before it is passed to the custom builder as well. Consider refactoring the logic to apply the casing transformation in _renderWeekDays before calling _weekdayContainer.

Comment thread lib/src/weekday_row.dart
final TextStyle? weekdayTextStyle;
final DateFormat localeDate;
final int firstDayOfWeek;
final bool upperCaseWeekDays;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

In WeekdayRow, existing properties such as showWeekdays, weekdayFormat, and weekdayTextStyle use a lowercase 'd' for 'weekday'. To maintain internal consistency within this file, consider naming this property upperCaseWeekdays (lowercase 'd'), even though CalendarCarousel uses an uppercase 'D' for showWeekDays.

@hyochan
Copy link
Copy Markdown
Owner

hyochan commented Apr 22, 2026

Bot review pass 1

  • Gemini (gemini-code-assist[bot]) — reviewed HEAD 9c18e0a: 2 medium-priority, non-blocking suggestions.
    • lib/src/weekday_row.dart:47upperCaseWeekDays is only applied to the default Text widget; when customWeekdayBuilder is provided, the original string is passed through un-uppercased. Consider applying the case transformation in _renderWeekDays so both paths behave consistently.
    • lib/src/weekday_row.dart:29 — other WeekdayRow properties use weekday (lowercase d); internal field could be upperCaseWeekdays even though the public CalendarCarousel parameter keeps WeekDays.
  • Copilot (copilot-pull-request-reviewer[bot]) — unavailable: request-reviewer API returned 422 "Reviews may only be requested from collaborators."
  • CodeRabbit (coderabbitai[bot]) — unavailable: no .coderabbit.yaml in the repo; app not installed.

No blockers. Merge is still gated by:

  1. CI has not run on this HEAD (0 check-runs, combined status pending). Approve the Actions workflow run for this external-contributor PR to let Flutter CI execute.
  2. Author has indicated on multiple occasions that the branch is not yet final (last commit 2025-03-19). Addressing at least the customWeekdayBuilder consistency nit would make the PR solid.

Classification: waiting-bots (effectively waiting-author).

Copy link
Copy Markdown
Owner

@hyochan hyochan left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution! Walked through the diff carefully. Two blockers and a small polish item before merge.

Blocker — customWeekdayBuilder path doesn't get uppercased

In lib/src/weekday_row.dart the .toUpperCase() only runs inside the non-custom-builder branch of _weekdayContainer (line 46 post-patch). Users who pass customWeekdayBuilder will still receive the original-case weekDayName even when upperCaseWeekDays: true. This is the same issue Gemini flagged.

Suggested fix: transform once in _renderWeekDays() before calling _weekdayContainer, e.g.:

weekDay = upperCaseWeekDays ? weekDay.toUpperCase() : weekDay;
list.add(_weekdayContainer(count, weekDay));

That way both the default path and the custom-builder path see the uppercased string, consistently.

Blocker — naming convention mismatch on the internal WeekdayRow field

The public field on CalendarCarousel (upperCaseWeekDays, capital D) matches the existing showWeekDays/weekDayFormat/weekDayMargin convention on that widget — that's fine, keep it.

But inside WeekdayRow everything else is lowercase d (showWeekdays, weekdayFormat, weekdayMargin, weekdayPadding, weekdayTextStyle). Please rename the new internal field to upperCaseWeekdays to match. Public API stays upperCaseWeekDays; only the WeekdayRow constructor parameter / field changes.

Polish — dartdoc

Per our contribution rules, every new public parameter on CalendarCarousel needs a /// dartdoc comment. One line is enough, e.g.:

/// Whether to render weekday labels in uppercase.
final bool upperCaseWeekDays;

Nice-to-have (not blocking)

A widget test confirming uppercase rendering with both the default path and a custom WeekdayBuilder would nail down the behavior.

Push the fixes and I'll re-review. 👍

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants