latias-date-format 0.1.1 → 0.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 +4 -4
- data/README.md +8 -5
- data/config/locales/th.yml +3 -1
- data/lib/latias/date/format/engine.rb +7 -0
- data/lib/latias/date/format/version.rb +1 -1
- data/lib/latias/date/{format.rb → formater.rb} +2 -4
- 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: 572ed128cee4d0d3729abee688a78cf9294eba20cc4e700311fc3c104199d6fe
|
4
|
+
data.tar.gz: d09dd7052c9aa0a23b59878c41751574ac0f1ce0d2552b0f9519aa8a1502fd0e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f3f2aa8cae62f8c3e3345d79ab2711fa4c1c71cd8450db637b83faca6ec5c66c1a6b9e5752ade67ae1c7d1d5b3c5e43f62bddc64dea401c5e6e82ed0c547fe17
|
7
|
+
data.tar.gz: c3e2fb39456409b2791a28cc1c0959c0e39f266c1cea372ea59699bfce12e7f2c95eb7f00e9c0731f34cb6ebf3e13a060625bf5979fbb66e27feddfd672e1f03
|
data/README.md
CHANGED
@@ -8,14 +8,12 @@ How to use my plugin.
|
|
8
8
|
Add this line to your application's Gemfile:
|
9
9
|
|
10
10
|
```ruby
|
11
|
-
gem 'latias-date-format', '0.1
|
11
|
+
gem 'latias-date-format', '~> 0.1'
|
12
|
+
# or
|
13
|
+
gem 'latias-date-format', '~> 0.1', git: 'https://nattanon:dT1Lcvf8pvGoU7LX4Uqr@gitlab.opensource-technology.com/nattanon/latias-date-format-rails.git'
|
12
14
|
```
|
13
15
|
|
14
16
|
## Examples
|
15
|
-
```ruby
|
16
|
-
include Latias::Date::Format
|
17
|
-
```
|
18
|
-
|
19
17
|
```ruby
|
20
18
|
2.6.5 :001 > buddist_date_format(Date.today) # Date
|
21
19
|
=> "15 มกราคม 2564"
|
@@ -29,6 +27,11 @@ include Latias::Date::Format
|
|
29
27
|
=> "ม.ค. 2564 17:20:23 +0700"
|
30
28
|
```
|
31
29
|
|
30
|
+
### Manual
|
31
|
+
```ruby
|
32
|
+
include Latias::Date::Formater
|
33
|
+
```
|
34
|
+
|
32
35
|
## Contributing
|
33
36
|
Contribution directions go here.
|
34
37
|
|
data/config/locales/th.yml
CHANGED
@@ -1,8 +1,15 @@
|
|
1
|
+
require 'latias/date/formater'
|
2
|
+
|
1
3
|
module Latias
|
2
4
|
module Date
|
3
5
|
module Format
|
4
6
|
class Engine < ::Rails::Engine
|
5
7
|
isolate_namespace Latias::Date::Format
|
8
|
+
# ActionController::Base.include Latias::Date::Format
|
9
|
+
ActionView::Base.include Latias::Date::Formater
|
10
|
+
ActiveSupport.on_load(:action_controller_base) do
|
11
|
+
include Latias::Date::Formater
|
12
|
+
end
|
6
13
|
end
|
7
14
|
end
|
8
15
|
end
|
@@ -1,8 +1,6 @@
|
|
1
|
-
require 'latias/date/format/engine'
|
2
|
-
|
3
1
|
module Latias
|
4
2
|
module Date
|
5
|
-
module
|
3
|
+
module Formater
|
6
4
|
def buddist_date_format(date, format: '%e %B %Y')
|
7
5
|
format = format.gsub('%Y', buddhist_year(date.year).to_s)
|
8
6
|
format = format.gsub('%y', (buddhist_year(date.year) % 100).to_s)
|
@@ -16,4 +14,4 @@ module Latias
|
|
16
14
|
end
|
17
15
|
end
|
18
16
|
|
19
|
-
extend Latias::Date::Format
|
17
|
+
# extend Latias::Date::Format
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: latias-date-format
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- nattanon
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-04-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -44,9 +44,9 @@ files:
|
|
44
44
|
- app/views/layouts/latias/date/format/application.html.erb
|
45
45
|
- config/locales/th.yml
|
46
46
|
- config/routes.rb
|
47
|
-
- lib/latias/date/format.rb
|
48
47
|
- lib/latias/date/format/engine.rb
|
49
48
|
- lib/latias/date/format/version.rb
|
49
|
+
- lib/latias/date/formater.rb
|
50
50
|
- lib/tasks/latias/date/format_tasks.rake
|
51
51
|
homepage: https://gitlab.opensource-technology.com/nattanon/latias-date-format-rails
|
52
52
|
licenses:
|