how to update gem build latias-date-format.gemspec gem push latias-date-format-0.1.6.gem -->
Latias::Date::Format
Short description and motivation.
Usage
How to use my plugin.
Installation
Add this line to your application's Gemfile:
gem 'latias-date-format', '~> 0.1'
# or
gem 'latias-date-format', '~> 0.1', git: 'https://nattanon:[email protected]/nattanon/latias-date-format-rails.git'
Examples
with I18n
3.0.1 :001 > I18n.l(date) # Date
=> "25 สิงหาคม 2564"
3.0.1 :002 > I18n.l(date, format: :full) # Date
=> "พุธ 25 สิงหาคม 2564"
3.0.1 :003 > I18n.l(date, format: :short) # Date
=> "สิงหาคม 2564"
3.0.1 :004 > I18n.l(date, format: :month) # Date
=> "สิงหาคม"
3.0.1 :005 > I18n.l(date, format: :year) # Date
=> "2564"
3.0.1 :006 > I18n.l(time) # DateTime
=> "25 สิงหาคม 2564 20:15:44"
3.0.1 :007 > I18n.l(time, format: :full) # DateTime
=> "พุธ 25 สิงหาคม 2564 20:15:44"
with function
2.6.5 :001 > buddist_date_format(Date.today) # Date
=> "15 มกราคม 2564"
2.6.5 :002 > buddist_date_format(Date.today, format: "%d") # Date
=> "15"
2.6.5 :003 > buddist_date_format(Date.today, format: "%d %y") # Date
=> "15 64"
2.6.5 :004 > buddist_date_format(Date.today, format: "%d %Y") # Date
=> "15 2564"
2.6.5 :005 > buddist_date_format(DateTime.now(), format: "%b %Y %H:%M:%S %z") # DateTime
=> "ม.ค. 2564 17:20:23 +0700"
Manual
include Latias::Date::Formater
Contributing
Contribution directions go here.
License
The gem is available as open source under the terms of the MIT License.