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

[55997] Add duration_format setting with hours_only by default #16017

Conversation

cbliard
Copy link
Member

@cbliard cbliard commented Jul 2, 2024

https://community.openproject.org/wp/55997

The duration_format setting can take two values: "hours_only" or "days_and_hours". The default value is "hours_only".

The duration_format setting is used to determine how durations are displayed in the frontend and in some exports.

It can be changed in Administration > Calendar and Dates > Working days and hours.

image

https://community.openproject.org/wp/55997

The `duration_format` setting can take two values: "hours_only" or
"days_and_hours". The default value is "hours_only".

The `duration_format` setting is used to determine how durations are
displayed in the frontend and in some exports.

It can be changed in Administration > Calendar and Dates > Working days
and hours.
@cbliard cbliard added this to the 14.3.x milestone Jul 2, 2024
Comment on lines +184 to +186
hours = hours.round(2)
hours_int = hours.to_i
hours = hours_int if hours - hours_int == 0 # if hours end with .0
Copy link
Contributor

Choose a reason for hiding this comment

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

Clever

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks! But actually, it's not mine. I copied it from another line:

int = seconds.to_i
seconds = int if seconds - int == 0 # if seconds end with .0

Copy link
Contributor

@aaron-contreras aaron-contreras left a comment

Choose a reason for hiding this comment

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

Excellent work! Gave it a thorough test

@cbliard cbliard merged commit 2956352 into dev Jul 3, 2024
14 checks passed
@cbliard cbliard deleted the feature/55997-allow-admins-to-choose-between-display-in-hours-only-or-days-and-hours branch July 3, 2024 07:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants