0.0
No release in over 3 years
Low commit activity in last 3 years
This creates a global default for date format
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies
 Project Readme

DateDefaulter

Gem Downloads Gem Version

Use this gem to set global defaults on how your Date is formatted when represented as a string.

Install

gem install date_defaulter

Usage

include DateDefaulter

# You can set the configuration directly
DateDefaulter.format = '%d/%m/%Y'
# or using a block
DateDefaulter.configuration do |configuration|
  configuration.format = '%d/%m/%Y'
end

date = Date.new(2016, 10, 21)

p date

=> "21/10/2016"

p date.strftime

=> "21/10/2016"

License

MIT