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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a3f5e69b2511ca44ede71a3ddc3c5a204e2346696696309ddfa38e985c275f09
4
- data.tar.gz: f01602e9b487ee80b131d46f9965446eafc503483f1bf2acd601d39d599b065f
3
+ metadata.gz: 572ed128cee4d0d3729abee688a78cf9294eba20cc4e700311fc3c104199d6fe
4
+ data.tar.gz: d09dd7052c9aa0a23b59878c41751574ac0f1ce0d2552b0f9519aa8a1502fd0e
5
5
  SHA512:
6
- metadata.gz: 689cc7bcbb3689a4150da250b9010f3561b5620f2d032ae7b10beee728c7da492d3f8df835d3f245b4d8ee10a39d5ab918a2d4ade68aed712e69ec44d0a676b4
7
- data.tar.gz: 0772c36969372fa7c81ae1a14b54e42df61395367199c1eb226f1360b507fd2e17a8258b5f58afaf3fdcea495eb3be683456927555013740bf6302c992b56b91
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.1', git: 'https://nattanon:dT1Lcvf8pvGoU7LX4Uqr@gitlab.opensource-technology.com/nattanon/latias-date-format-rails.git'
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
 
@@ -27,4 +27,6 @@ th:
27
27
  - กันยายน
28
28
  - ตุลาคม
29
29
  - พฤศจิกายน
30
- - ธันวาคม
30
+ - ธันวาคม
31
+ day_names: [อาทิตย์, จันทร์, อังคาร, พุธ, พฤหัสบดี, ศุกร์, เสาร์]
32
+ abbr_day_names: [อา., จ., อ., พ., พฤ., ศ., ส.]
@@ -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,7 +1,7 @@
1
1
  module Latias
2
2
  module Date
3
3
  module Format
4
- VERSION = '0.1.1'.freeze
4
+ VERSION = '0.1.6'.freeze
5
5
  end
6
6
  end
7
7
  end
@@ -1,8 +1,6 @@
1
- require 'latias/date/format/engine'
2
-
3
1
  module Latias
4
2
  module Date
5
- module Format
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.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-01-22 00:00:00.000000000 Z
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: