anoubis 1.0.10 → 1.0.11

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: cc8ceeedc090ec925b88f60a4590f8cbdd834818d47ce9f5478c7f7a425ed381
4
- data.tar.gz: 3ffc744a25fbf9cef5506538898902eb55ec8283505292c66fb14740b7fb6d5e
3
+ metadata.gz: bf335652633d8a19ba9854e96b60cd818f99c2771722228dd0d314f7af4b3707
4
+ data.tar.gz: e098b7d9cde7bdf2ce46a7795caf4ad528a10e66db2fe2769b1c4f27f7f9c32c
5
5
  SHA512:
6
- metadata.gz: 28801bcc259fe678bbffb89d96a36c5d31fb47b9aa4ea1fe82f59e1434142b93032587806a0882c4948b743272b0c2c5306fbf2952ecf5b9fef0c799e3446e97
7
- data.tar.gz: d2bfc2c2e958e790f8f5b8aa4bd8bea22b9e9931d65a598668900afffddd7b97363e596f07d168d663f65d9cee2046b2008f2e659783f5854f162758903cb070
6
+ metadata.gz: 02dc93037f10b7a415c890281c560ba62aed67c6a3259026452ede7aa968d0a48a96f3fde0e2170b80ded9e03ee980b64cbb38f9ed8ab1f03b23ce2648579c91
7
+ data.tar.gz: c28deec639a31e35f36535d78d404389975813ef53996682780287bb699c464abb7246c3999f31e6909237cdcacedf0be04c6ebae280efe243a55ec04ae931ab
@@ -139,8 +139,8 @@ module Anoubis
139
139
  # Convert value from database to table view for datetime type
140
140
  def convert_db_to_view_value_datetime(key, value)
141
141
  field = self.etc.data.fields[key]
142
- #puts key
143
- #puts value.class
142
+ puts key
143
+ puts value.class
144
144
  if (value.class == Date) || (value.class == ActiveSupport::TimeWithZone)
145
145
  begin
146
146
  new_value = convert_datetime_to_string value, field.format
@@ -182,11 +182,11 @@ module Anoubis
182
182
  # @param format [String] convert representation ('month' - return only month and year, 'date' - returns only date, 'datetime' - returns date and time)
183
183
  # @return Returns date and time representation string
184
184
  def convert_datetime_to_string(value, format)
185
- return I18n.t('anubis.months.main')[value.month-1]+' '+value.year.to_s if format == 'month'
186
- return value.day.to_s+' '+ I18n.t('anubis.months.second')[value.month-1]+' '+value.year.to_s if format == 'date'
187
- return value.day.to_s+' '+ I18n.t('anubis.months.second')[value.month-1]+' '+value.year.to_s+', '+value.hour.to_s+':'+('%02d' % value.min) if format == 'datetime'
185
+ return I18n.t('anoubis.months.main')[value.month-1]+' '+value.year.to_s if format == 'month'
186
+ return value.day.to_s+' '+ I18n.t('anoubis.months.second')[value.month-1]+' '+value.year.to_s if format == 'date'
187
+ return value.day.to_s+' '+ I18n.t('anoubis.months.second')[value.month-1]+' '+value.year.to_s+', '+value.hour.to_s+':'+('%02d' % value.min) if format == 'datetime'
188
188
 
189
- value.day.to_s+' '+ I18n.t('anubis.months.second')[value.month-1]+' '+value.year.to_s+', '+value.hour.to_s+':'+('%02d' % value.min)+':'+('%02d' % value.sec)
189
+ value.day.to_s+' '+ I18n.t('anoubis.months.second')[value.month-1]+' '+value.year.to_s+', '+value.hour.to_s+':'+('%02d' % value.min)+':'+('%02d' % value.sec)
190
190
  end
191
191
 
192
192
 
@@ -236,10 +236,10 @@ module Anoubis
236
236
  def convert_db_to_table_value_datetime1(key, field, value)
237
237
  begin
238
238
  value = case field[:format]
239
- when 'month' then I18n.t('months.main')[value.month-1]+' '+value.year.to_s
240
- when 'date' then value.day.to_s+' '+ I18n.t('months.second')[value.month-1]+' '+value.year.to_s
241
- when 'datetime' then value.day.to_s+' '+ I18n.t('months.second')[value.month-1]+' '+value.year.to_s+', '+value.hour.to_s+':'+('%02d' % value.min)
242
- else value.day.to_s+' '+ I18n.t('months.second')[value.month-1]+' '+value.year.to_s+', '+value.hour.to_s+':'+('%02d' % value.min)+':'+('%02d' % value.sec)
239
+ when 'month' then I18n.t('anoubis.months.main')[value.month-1]+' '+value.year.to_s
240
+ when 'date' then value.day.to_s+' '+ I18n.t('anoubis.months.second')[value.month-1]+' '+value.year.to_s
241
+ when 'datetime' then value.day.to_s+' '+ I18n.t('anoubis.months.second')[value.month-1]+' '+value.year.to_s+', '+value.hour.to_s+':'+('%02d' % value.min)
242
+ else value.day.to_s+' '+ I18n.t('anoubis.months.second')[value.month-1]+' '+value.year.to_s+', '+value.hour.to_s+':'+('%02d' % value.min)+':'+('%02d' % value.sec)
243
243
  end
244
244
  rescue
245
245
  value = I18n.t('incorrect_field_format')
@@ -266,10 +266,10 @@ module Anoubis
266
266
  def convert_db_to_table_value_datetime(key, field, value)
267
267
  begin
268
268
  value = case field[:format]
269
- when 'month' then I18n.t('months.main')[value.month-1]+' '+value.year.to_s
270
- when 'date' then value.day.to_s+' '+ I18n.t('months.second')[value.month-1]+' '+value.year.to_s
271
- when 'datetime' then value.day.to_s+' '+ I18n.t('months.second')[value.month-1]+' '+value.year.to_s+', '+value.hour.to_s+':'+('%02d' % value.min)
272
- else value.day.to_s+' '+ I18n.t('months.second')[value.month-1]+' '+value.year.to_s+', '+value.hour.to_s+':'+('%02d' % value.min)+':'+('%02d' % value.sec)
269
+ when 'month' then I18n.t('anoubis.months.main')[value.month-1]+' '+value.year.to_s
270
+ when 'date' then value.day.to_s+' '+ I18n.t('anoubis.months.second')[value.month-1]+' '+value.year.to_s
271
+ when 'datetime' then value.day.to_s+' '+ I18n.t('anoubis.months.second')[value.month-1]+' '+value.year.to_s+', '+value.hour.to_s+':'+('%02d' % value.min)
272
+ else value.day.to_s+' '+ I18n.t('anoubis.months.second')[value.month-1]+' '+value.year.to_s+', '+value.hour.to_s+':'+('%02d' % value.min)+':'+('%02d' % value.sec)
273
273
  end
274
274
  rescue
275
275
  value = I18n.t('incorrect_field_format')
@@ -57,6 +57,46 @@ ru:
57
57
  edit: "Редактирование элемента: %{title}"
58
58
  show: "Просмотр элемента: %{title}"
59
59
  new: "Добавление нового элемента"
60
+ months:
61
+ main:
62
+ - "Январь"
63
+ - "Февраль"
64
+ - "Март"
65
+ - "Апрель"
66
+ - "Май"
67
+ - "Июнь"
68
+ - "Июль"
69
+ - "Август"
70
+ - "Сентябрь"
71
+ - "Октябрь"
72
+ - "Ноябрь"
73
+ - "Декабрь"
74
+ second:
75
+ - "Января"
76
+ - "Февраля"
77
+ - "Марта"
78
+ - "Апреля"
79
+ - "Мая"
80
+ - "Июня"
81
+ - "Июля"
82
+ - "Августа"
83
+ - "Сентября"
84
+ - "Октября"
85
+ - "Ноября"
86
+ - "Декабря"
87
+ short:
88
+ - "янв"
89
+ - "фев"
90
+ - "мар"
91
+ - "апр"
92
+ - "май"
93
+ - "июн"
94
+ - "июл"
95
+ - "авг"
96
+ - "сен"
97
+ - "окт"
98
+ - "ноя"
99
+ - "дек"
60
100
 
61
101
 
62
102
 
@@ -74,46 +114,6 @@ ru:
74
114
  error_changing_data: Ошибка изменения данных
75
115
 
76
116
 
77
- months:
78
- main:
79
- - Январь
80
- - Февраль
81
- - Март
82
- - Апрель
83
- - Май
84
- - Июнь
85
- - Июль
86
- - Август
87
- - Сентябрь
88
- - Октябрь
89
- - Ноябрь
90
- - Декабрь
91
- second:
92
- - Января
93
- - Февраля
94
- - Марта
95
- - Апреля
96
- - Мая
97
- - Июня
98
- - Июля
99
- - Августа
100
- - Сентября
101
- - Октября
102
- - Ноября
103
- - Декабря
104
- short:
105
- - янв
106
- - фев
107
- - мар
108
- - апр
109
- - май
110
- - июн
111
- - июл
112
- - авг
113
- - сен
114
- - окт
115
- - ноя
116
- - дек
117
117
  install2:
118
118
  groups:
119
119
  admin: Администраторы
@@ -1,5 +1,5 @@
1
1
  module Anoubis
2
2
  ##
3
3
  # Anoubis current version
4
- VERSION = '1.0.10'
4
+ VERSION = '1.0.11'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: anoubis
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.10
4
+ version: 1.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrey Ryabov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-05-03 00:00:00.000000000 Z
11
+ date: 2022-05-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -321,7 +321,7 @@ metadata:
321
321
  homepage_uri: https://github.com/RA-Company/
322
322
  source_code_uri: https://github.com/RA-Company/anoubis
323
323
  changelog_uri: https://github.com/RA-Company/anoubis/blob/main/CHANGELOG.md
324
- documentation_uri: https://www.rubydoc.info/gems/anoubis/1.0.10
324
+ documentation_uri: https://www.rubydoc.info/gems/anoubis/1.0.11
325
325
  post_install_message:
326
326
  rdoc_options: []
327
327
  require_paths: