redmineup 1.1.5 → 1.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9c4e8d46bd4c3ebd697d05c40fc8900740776edfdc51ec30752a6494a8d98507
4
- data.tar.gz: d4415eb58846ecf74a3b810f6db81a682f56f2ee482b600ba39d89fbc977f1d1
3
+ metadata.gz: ffc6eee33542600145eba2fd7789b0b4166fc992752e1ae73123d2b92a290588
4
+ data.tar.gz: 2f1bb7682cea36f0bab2481fe3e13f67e54736bd0751442d4e90652144a73589
5
5
  SHA512:
6
- metadata.gz: 5f5211fe4abe7bb5fd64b352a7af46dd6b4626defdb749c8e63c75d7a37e156efec7367ded620aeb26721d5ca2138eb39c9f5f95d6ddeaced3e0aa6613933858
7
- data.tar.gz: f914518e862acb09d5355c672e08f62e997f8d839f33c480b072f423c1f9070916726c5e83bf9d51250a84930e7c0108ad404453cc9b2e2d146a7e338390f01e
6
+ metadata.gz: 398413f2a14e103ab19db992c186d142fe7acfb31a9c90a26b56880cfa084662250dd807d362a533ede13fd2f0df00813eeefb05c9f1869a37e74158da2d4eb3
7
+ data.tar.gz: b344e60e5a6dc5f551da6cd17fa2a055445a3a1dbac62647a8677a07e1c06c092fe10fcce12c8e944ffb6b3b2136bac9c25a5c6416c1289af84de514d5e05afb
data/doc/CHANGELOG CHANGED
@@ -4,6 +4,10 @@ Redmine UP gem - general functions for plugins (tags, vote, viewing, currency)
4
4
  Copyright (C) 2011-2026 Kirill Bezrukov (RedmineUP)
5
5
  https://www.redmineup.com/
6
6
 
7
+ == 2026-04-17 v1.1.6
8
+
9
+ * Added helpers for timezone conversions
10
+
7
11
  == 2026-04-17 v1.1.5
8
12
 
9
13
  * Added tag cloud links helper with URL convention by key
@@ -142,7 +142,7 @@ module Redmineup
142
142
  scope = scope.where("#{table_name}.project_id IN (%s)", projects.map(&:id).join(','))
143
143
  end
144
144
 
145
- if options[:name_like]
145
+ if options[:name_like].present?
146
146
  scope = scope.where("LOWER(#{Tag.table_name}.name) LIKE LOWER(?)", "%#{options[:name_like]}%")
147
147
  end
148
148
 
@@ -0,0 +1,23 @@
1
+ module Redmineup
2
+ module DatetimeHelper
3
+ def convert_time_to_user_timezone(time)
4
+ if User.current.time_zone
5
+ time.in_time_zone(User.current.time_zone)
6
+ else
7
+ time.utc? ? time.localtime : time
8
+ end
9
+ end
10
+
11
+ def convert_time_to_utc(time = Time.now)
12
+ return Time.now.utc if time.blank?
13
+ return time.utc if time.respond_to?(:utc)
14
+
15
+ time_zone = User.current.time_zone
16
+ return Time.parse(time).utc unless time_zone
17
+
18
+ Time.use_zone(time_zone) do
19
+ Time.zone.parse(time).utc
20
+ end
21
+ end
22
+ end
23
+ end
@@ -2,12 +2,12 @@ module Redmineup
2
2
  module Patches
3
3
  module AutoCompletesControllerPatch
4
4
  DEFAULT_TAGS_LIMIT = 10
5
-
6
- def taggable_tags
7
5
 
6
+ def taggable_tags
8
7
  limit = params.delete(:limit) || DEFAULT_TAGS_LIMIT
9
8
  klass = Object.const_get(params[:taggable_type].camelcase) if params[:taggable_type].present?
10
- tags = klass && klass.available_tags(params.merge(limit: limit)) || Redmineup::ActsAsTaggable::Tag.limit(limit)
9
+
10
+ tags = klass && klass.available_tags(params.merge(limit: limit, name_like: params[:q])) || Redmineup::ActsAsTaggable::Tag.limit(limit)
11
11
  render json: tags.map { |tag| { id: tag.name, text: tag.name } }
12
12
  end
13
13
  end
@@ -16,4 +16,4 @@ end
16
16
 
17
17
  unless AutoCompletesController.included_modules.include?(Redmineup::Patches::AutoCompletesControllerPatch)
18
18
  AutoCompletesController.include(Redmineup::Patches::AutoCompletesControllerPatch)
19
- end
19
+ end
@@ -1,3 +1,3 @@
1
1
  module Redmineup
2
- VERSION = '1.1.5'
2
+ VERSION = '1.1.6'
3
3
  end
data/lib/redmineup.rb CHANGED
@@ -44,6 +44,7 @@ require 'redmineup/liquid/drops/custom_field_enumeration_drop'
44
44
  require 'redmineup/helpers/external_assets_helper'
45
45
  require 'redmineup/helpers/form_tag_helper'
46
46
  require 'redmineup/helpers/calendars_helper'
47
+ require 'redmineup/helpers/datetime_helper'
47
48
  require 'redmineup/assets_manager'
48
49
 
49
50
  require 'redmineup/patches/liquid_patch'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redmineup
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.5
4
+ version: 1.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - RedmineUP
@@ -167,6 +167,7 @@ files:
167
167
  - lib/redmineup/currency/loader.rb
168
168
  - lib/redmineup/engine.rb
169
169
  - lib/redmineup/helpers/calendars_helper.rb
170
+ - lib/redmineup/helpers/datetime_helper.rb
170
171
  - lib/redmineup/helpers/external_assets_helper.rb
171
172
  - lib/redmineup/helpers/form_tag_helper.rb
172
173
  - lib/redmineup/helpers/tags_helper.rb