Skip to content

Commit

Permalink
use less conflicting namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
ulferts committed Feb 14, 2025
1 parent f46db86 commit e9e79b4
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def today
end

def beginning_of_week
OpenProject::I18n::Date.time_at_beginning_of_week
OpenProject::Internationalization::Date.time_at_beginning_of_week
end

def end_of_week
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,11 @@
# See COPYRIGHT and LICENSE files for more details.
# ++

# The module is not called I18n as that leads to tons of conflicts
# where I18n is called within the OpenProject module and rails I18n is meant.

module OpenProject
module I18n
module Internationalization
module Date
module_function

Expand Down
2 changes: 1 addition & 1 deletion lib_static/redmine/i18n.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#++

# This file is to be split up into smaller files in the OpenProject namespace.
# A start has been made by splitting off OpenProject::I18n::Date into its own file.
# A start has been made by splitting off OpenProject::Internationalization::Date into its own file.

module Redmine
module I18n
Expand Down
2 changes: 1 addition & 1 deletion modules/meeting/app/controllers/meetings_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ def load_meetings
end

def group_meetings(all_meetings) # rubocop:disable Metrics/AbcSize
next_week = Time.current.next_occurring(OpenProject::I18n::Date.start_of_week)
next_week = Time.current.next_occurring(OpenProject::Internationalization::Date.start_of_week)
groups = Hash.new { |h, k| h[k] = [] }
groups[:later] = show_more_pagination(all_meetings
.where(start_time: next_week..)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

require "spec_helper"

RSpec.describe OpenProject::I18n::Date do
RSpec.describe OpenProject::Internationalization::Date do
describe ".beginning_of_week" do
context "when the first day of the week is Sunday", with_settings: { start_of_week: 7 } do
it "returns :sunday" do
Expand Down

0 comments on commit e9e79b4

Please sign in to comment.