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 +4 -4
- data/app/controllers/anoubis/data/convert.rb +14 -14
- data/config/locales/ru.yml +40 -40
- data/lib/anoubis/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bf335652633d8a19ba9854e96b60cd818f99c2771722228dd0d314f7af4b3707
|
4
|
+
data.tar.gz: e098b7d9cde7bdf2ce46a7795caf4ad528a10e66db2fe2769b1c4f27f7f9c32c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
143
|
-
|
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('
|
186
|
-
return value.day.to_s+' '+ I18n.t('
|
187
|
-
return value.day.to_s+' '+ I18n.t('
|
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('
|
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')
|
data/config/locales/ru.yml
CHANGED
@@ -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: Администраторы
|
data/lib/anoubis/version.rb
CHANGED
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.
|
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-
|
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.
|
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:
|