latias-date-format 0.1.4 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +40 -1
- data/config/locales/th.rb +22 -0
- data/config/locales/th.yml +3 -1
- data/lib/latias/date/format/engine.rb +0 -1
- data/lib/latias/date/format/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cf33d28866340d27a537043b57b7cd65b65c4b4f264c7ff6c306f7c91eba1bcd
|
4
|
+
data.tar.gz: 987e27304adff1009b6de738bfb06909d93c23e37fb1b843ac22d0e57a24dda6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ebbf0639729f3b07eeba1256397bb3320c515152d4afd79f03ea129c238c74e8dc52a03d5ec856d1f9c1296a9d3e1cad5a8c266d7766311755dbcc462fc56618
|
7
|
+
data.tar.gz: d3492bd9425d5c779c9a5829a4b18155f26db823dc8d509f51de62081db5e89e7d38040622ee14037a6aabb3e206818ed77bd4384026baae832f992b3f018add
|
data/README.md
CHANGED
@@ -1,19 +1,50 @@
|
|
1
|
+
<!--
|
2
|
+
how to update
|
3
|
+
gem build latias-date-format.gemspec
|
4
|
+
gem push latias-date-format-0.1.6.gem
|
5
|
+
-->
|
6
|
+
|
1
7
|
# Latias::Date::Format
|
8
|
+
|
2
9
|
Short description and motivation.
|
3
10
|
|
4
11
|
## Usage
|
12
|
+
|
5
13
|
How to use my plugin.
|
6
14
|
|
7
15
|
## Installation
|
16
|
+
|
8
17
|
Add this line to your application's Gemfile:
|
9
18
|
|
10
19
|
```ruby
|
11
|
-
gem 'latias-date-format', '~> 0.1
|
20
|
+
gem 'latias-date-format', '~> 0.1'
|
12
21
|
# or
|
13
22
|
gem 'latias-date-format', '~> 0.1', git: 'https://nattanon:dT1Lcvf8pvGoU7LX4Uqr@gitlab.opensource-technology.com/nattanon/latias-date-format-rails.git'
|
14
23
|
```
|
15
24
|
|
16
25
|
## Examples
|
26
|
+
|
27
|
+
#### with I18n
|
28
|
+
|
29
|
+
```ruby
|
30
|
+
3.0.1 :001 > I18n.l(date) # Date
|
31
|
+
=> "25 สิงหาคม 2564"
|
32
|
+
3.0.1 :002 > I18n.l(date, format: :full) # Date
|
33
|
+
=> "พุธ 25 สิงหาคม 2564"
|
34
|
+
3.0.1 :003 > I18n.l(date, format: :short) # Date
|
35
|
+
=> "สิงหาคม 2564"
|
36
|
+
3.0.1 :004 > I18n.l(date, format: :month) # Date
|
37
|
+
=> "สิงหาคม"
|
38
|
+
3.0.1 :005 > I18n.l(date, format: :year) # Date
|
39
|
+
=> "2564"
|
40
|
+
3.0.1 :006 > I18n.l(time) # DateTime
|
41
|
+
=> "25 สิงหาคม 2564 20:15:44"
|
42
|
+
3.0.1 :007 > I18n.l(time, format: :full) # DateTime
|
43
|
+
=> "พุธ 25 สิงหาคม 2564 20:15:44"
|
44
|
+
```
|
45
|
+
|
46
|
+
### with function
|
47
|
+
|
17
48
|
```ruby
|
18
49
|
2.6.5 :001 > buddist_date_format(Date.today) # Date
|
19
50
|
=> "15 มกราคม 2564"
|
@@ -27,8 +58,16 @@ gem 'latias-date-format', '~> 0.1', git: 'https://nattanon:dT1Lcvf8pvGoU7LX4Uqr@
|
|
27
58
|
=> "ม.ค. 2564 17:20:23 +0700"
|
28
59
|
```
|
29
60
|
|
61
|
+
### Manual
|
62
|
+
|
63
|
+
```ruby
|
64
|
+
include Latias::Date::Formater
|
65
|
+
```
|
66
|
+
|
30
67
|
## Contributing
|
68
|
+
|
31
69
|
Contribution directions go here.
|
32
70
|
|
33
71
|
## License
|
72
|
+
|
34
73
|
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
@@ -0,0 +1,22 @@
|
|
1
|
+
{
|
2
|
+
th: {
|
3
|
+
date: {
|
4
|
+
formats: {
|
5
|
+
default: ->(date) { "%-d %B #{date.year + 543}" },
|
6
|
+
short: ->(date) { "%B #{date.year + 543}" },
|
7
|
+
month: ->(_date) { '%B' },
|
8
|
+
year: ->(date) { date.year + 543 }
|
9
|
+
}
|
10
|
+
},
|
11
|
+
time_with_zone: {
|
12
|
+
formats: {
|
13
|
+
default: ->(time) { "%d %B #{time.year + 543} %H:%M:%S" }
|
14
|
+
}
|
15
|
+
},
|
16
|
+
time: {
|
17
|
+
formats: {
|
18
|
+
default: ->(time) { "%d %B #{time.year + 543} %H:%M:%S" }
|
19
|
+
}
|
20
|
+
}
|
21
|
+
}
|
22
|
+
}
|
data/config/locales/th.yml
CHANGED
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.8
|
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-08-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -42,6 +42,7 @@ files:
|
|
42
42
|
- app/mailers/latias/date/format/application_mailer.rb
|
43
43
|
- app/models/latias/date/format/application_record.rb
|
44
44
|
- app/views/layouts/latias/date/format/application.html.erb
|
45
|
+
- config/locales/th.rb
|
45
46
|
- config/locales/th.yml
|
46
47
|
- config/routes.rb
|
47
48
|
- lib/latias/date/format.rb
|