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

Custom hour of day label formatter #42

Closed
wants to merge 11 commits into from

Conversation

kennethj
Copy link

@kennethj kennethj commented Jul 19, 2020

These changes add the features to custom the hour column. Currently, we can only set the TextStyle with the hour format of HH:mm and column width set at 48.0. This update adds the ability to set custom time formatting and column width.

  • Adds theme property for formatting the hour of the day label.
  • Adds theme property to set the width of hour column

Example

final theme = TimetableThemeData(
  formatHour: (time) => '${time.hourOf12HourClock} ${time.hourOfDay > 11 ? "PM" : "AM"}',
  hourColumnWidth: 40,
);

Checklist

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

Screenshots

Format hour

Android iOS
Screen Shot 2020-07-19 at 4 16 10 PM Screen Shot 2020-07-19 at 4 19 12 PM

Set column width

Larger Zero width
Screen Shot 2020-07-20 at 9 56 19 AM Screen Shot 2020-07-20 at 9 56 32 AM

@TheMkrage
Copy link

Is there any plan for this still? This is something we would love to make use of! Thank you

@IoanaAlexandru
Copy link

@TheMkrage while waiting for a PR to get approved, you can always just specify it in your dependencies:

timetable:
    git: https://github.com/iu-uits-es/timetable.git

@TatsuUkraine
Copy link
Contributor

@JonasWanke any timeline when this feature will be merged?

@TatsuUkraine
Copy link
Contributor

nvm) this solution still doesn't fit for me))) I need more customizable time labels)))

@Ahmadre
Copy link

Ahmadre commented Mar 16, 2021

@kennethj could you please check the conflicts? And @JonasWanke Any feedback to this?

@JonasWanke
Copy link
Owner

Thanks for your efforts! Due to the major refactor tracked in #17, I, unfortunately, can't directly use this PR, but am incorporating customizable time labels supporting custom widgets (addressing #41, #58, and #61).

@JonasWanke JonasWanke closed this Jun 6, 2021
@JonasWanke JonasWanke deleted the branch JonasWanke:master June 6, 2021 17:19
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.

7 participants